Ask your own question, for FREE!
Computer Science 15 Online
OpenStudy (anonymous):

Using matlab can we draw a digital signal out of an array that contains numbers ? Is there a way to convert each number to binary "dec2bin" and then draw it ?

OpenStudy (anonymous):

just to clarify, the array only contains decimal numbers I want to draw the binary numbers corresponding to each one of them to get a digital signal .

OpenStudy (carlsmith):

You want to convert integers from base10 to their binary representation and then plot them on a graph? Both are pretty simple tasks, but I'm thinking that the binary representations would have the same position on the graph as they would if they were in base10 or hex or any other base. Wouldn't it just be the same graph, produced from the same data? Perhaps I'm not getting it.

OpenStudy (anonymous):

Well I'm actually stuck in the ploting process I have a decimal number "in fact array of decimal numbers" and when I convert it into binary "dec2bin" all I have is a string , so what is the way to draw a string of zeros and ones taking in consideration that the plot of each string must appear once the one before it ends. Thanks a lot for the reply. I appreciate it .

OpenStudy (anonymous):

Well I'm actually stuck in the ploting process I have a decimal number "in fact array of decimal numbers" and when I convert it into binary "dec2bin" all I have is a string , so what is the way to draw a string of zeros and ones taking in consideration that the plot of each string must appear once the one before it ends. Thanks a lot for the reply. I appreciate it .

OpenStudy (carlsmith):

You understand that a string of ones and zeros is a number. 0 = 0 1 = 1 10 = 2 11 = 3 100 = 4 101 = 5 So if you take any string of binary, you can plot it on a graph as you normally would plot base10 numbers. 111 110 101 x 100 011 x 010 x 001 000 0 1 2 3 4 5 6 7 8 9 I'm not sure I understand what you're asking for. I am sorry, I'm genuinely interested. Let me know if I'm not getting something and I'll try and help.

OpenStudy (carlsmith):

Are you saying that when you convert a bunch of decs to binary, you just get one big binary string and you need each of the decs as an individual binary string? You'd need to set up some kind of loop that'll do each dec one by one?? I'm a bit lost to be honest.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!