لو سمحتوا ضروري

السلام عليكم
لو سمحتو أعضاء المنتدى , عندي عرض والمطلوب تحويل كل من decimal,octal,hexdecimal
إلى binary , باستخدام GUI ولازم يكون 8 bits>>> حاولت كذا مره باستخدام loopl بس ما اشتغل معاي … فلو تقدرون تساعدوني…

يا مهندسين الدكتور ما بدو تستخدم فنكشن متل مثلا ال
dec2bin بدو تستخدم اللووب كيف مابعرف؟؟

بتمنى توصلك المساعدة بسرعة انجنير 2011 وموفقة حبيبتي

there are build in function the converst between these bases system
but also you can do it by yourself all thing that you have to have it understand how to convert
then the programming will be easy
if you tried to implement it’s and you have problem please show me where are you stope
and i hope i will help you
thanks

Hi wahabk1
I used this func to convert from decimal 2 binary

t=str2num(get(handles.n_input1,‘string’));
str=dec2bin(t,8);
set(handles.n_output,
‘string’,str);
cuz i couldnt use loop

and that code is working with me
but my problem << i didnt find code to convert hex and oct to binary
Thnx alot anyway

and this by loop
number=input(‘Enter the number:’);
whileCOLOR=#000000[/color]
binary = rem(number,2);
disp(binary);
number=number/2;
[FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]
end

>>but also dosent work
plz if u can help me as soon as possible

[/color][/size][/font][/color][/size][/font][/color][/size][/font]

it is a game you can paly it

you convert the hex digits into dec and then from dec to bin

let  BB3C be the hex digits
and M is dec number
Bin is the binary number
M=hex2dec('BB3C');
Bin=dec2bin(M);

same thing with octal
convert from octal to decimal and the from decimal to binary


M=oct2dec(256);
Bin=dec2bin(M);
 

عــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــذرا حبوبه تأخرت عليك

>>>>>>>>>>>>>>>>Thnx alot Wahabk1

you welcomeeeeeeeeeeee