converting to binary (w,t)
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
i have this stored as .mat format. when i use plot (t,w) it gives me a graph which kinda looks like a sine graph. I want to convert them to binary format (e.g. 100101010....) and store them as either binary format .bin or as a .txt file. can someone help me out.
they are positive and negative numbers which are relatively very small.
t=[5.97388000000000e-11 1.59738800000000e-10 2.59738800000000e-10 3.59738800000000e-10 4.59738800000000e-10 5.59738800000000e-10 6.59738800000000e-10 7.59738800000000e-10 8.59738800000000e-10 9.59738800000000e-10]
w= [0.000200000000000000 0.000120000000000000 -4.00000000000000e-05 -0.000120000000000000 0.000280000000000000 0.000520000000000000 0.000440000000000000 0.000440000000000000 0.000520000000000000 0.000600000000000000]
please give me comments on ur code. and also give me as examples so that it is easy for me to follow. thank you so much guys! matlab forum is so good.
Respuestas (1)
Walter Roberson
el 9 de Mayo de 2012
As I wrote in your earlier question,
Strings of '0' and '1' as produced by dec2bin() is not called "binary" in traditional computer programming. "binary" in traditional computer programming always refers to a numeric format, not to a string format.
Let us take one of your data points, 0.000200000000000000 : exactly what do you want emitted for that? Be sure to distinguish between bytes that are numerically 0 or numerically 1, and bits that are numerically 0 or numerically 1, and characters that are '0' or '1' (which are bytes whose numeric values are 48 or 49.)
Ver también
Categorías
Más información sobre Data Type Conversion en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!