Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- X = -1.2356
- if X < 0
- array(1) = 1;
- else
- array(1) = 0;
- end
- a = abs(ceil(X));
- A = dec2bin(a,3);
- array(2) = str2double(A(1));
- array(3) = str2double(A(2));
- array(4) = str2double(A(3));
- b = num2str(abs(X));
- c = str2double([b(3) b(4)]);
- d = str2double([b(5) b(6)]);
- if 2*c >100
- array(5) = 1;
- else
- array(5) = 0;
- end
- if 2*d >100
- array(6) = 1;
- else
- array(6) = 0;
- end
- array
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement