Q:

How to convert positive integer to binary representation in the form of a string? Matlab

So far I have Bin=zeros(10,1);
Bin(1,1)=1;
Bin(2,1)=2;
c=ones(1,10);

for (i=3:10)
    Bin(i)=Bin(i-1)*2;
end
P=Bin

for (i=1:10)
    if (N<=Bin(i,1))
    c(i)=0;
    end

end

which takes the integer and makes all the binary digits greater than N 0. But I don't know what to do afterwards. Any help would be much appreciated! I'm rather new to this

A:

Call dec2bin(x), where x is your integer.  This returns the string that you want.  Should be built-in to Matlab.

