Plotting Graph that needs automated value for x-axis
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
Hello.
I am working in plotting a graph where the y-axis is the data from the file I choose. However, for the x-axis, is it possible for matlab to automatically give 0.01 interval from the first value till the last value in the file and the file has no fixed amount of data.
Really appreciate if anyone can give some advice. Thanks!
Regards,
Jeb
0 件のコメント
回答 (1 件)
Geoff Hayes
2016 年 1 月 29 日
Jeb - how do you determine the first and last value in the file? If you know both, then you could do something like
firstValue = 1.0;
lastValue = 5.0;
x = firstValue:0.01:lastValue;
Since you are using the above to plot presumably as
plot(x,y)
then the number of elements (length) of x must be identical to the number of elements of y.
1 件のコメント
Jeb
2016 年 1 月 29 日
この質問は閉じられています。
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!