Please can somebody expain this code.

2 views (last 30 days)
Syed Bilal
Syed Bilal on 17 Mar 2014
Commented: Kevin Claytor on 17 Mar 2014
tic
M = 'FFFFFFFFFFFFFFFF';
MB=[];
for i=1:16
Mi=M(i);
MBi=['0000',dec2bin(hex2dec(Mi))];
MBi=MBi(end-3:end);
MBi=[str2num(MBi(1)),str2num(MBi(2)),str2num(MBi(3)),str2num(MBi(4))];
end
M=MB
  1 Comment
Kevin Claytor
Kevin Claytor on 17 Mar 2014
Did you have a look at the docs:
They pretty much explain it. If you still don't understand the whole thing, post back with what you do understand and where you're getting stuck. You might also find;
helpful.
I'm disappointed that I can't add the the link markup into code segments. It would have been more fun that way.

Sign in to comment.

Answers (0)

Categories

Find more on Data Type Conversion in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!