Imperfect Plot
1 回表示 (過去 30 日間)
古いコメントを表示
I have a problem for plotting so it can make a squarewaveform.
here is my code
x=0:5:5000;
a='q';
bitk = reshape(dec2bin(double(a),8).' - '0', 1, []);
stairs(handles.axes1,x(1:length(bitk)),bitk(1:length(bitk)));
xlim(handles.axes1,[0 50]);
ylim(handles.axes1,[-1 2]);
the result is the graph isn't a squarewaveform. but the plot stairs is cut at bit 8. how can I fix this problem so at bit 8 make a squarewave and the rest of plot is 0?
0 件のコメント
回答 (1 件)
Andreas Goser
2011 年 7 月 27 日
When I remove 'handles.axes1' from your code and execute it, I see a figure with xlimits 0:35 and ylimits 0:1. This is exactly what is represented by the data x and bitk. I do not understand "but the plot stairs is cut at bit 8".
You may look for the AXIS command?
2 件のコメント
Andreas Goser
2011 年 7 月 27 日
In this case, I do not see alternatives to modify the data. PLOT, STAIRS etc. just display the data they have.
参考
カテゴリ
Help Center および File Exchange で Line Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!