Suppose we have 2000 matrices and for each matrix we have a real value between [-3,3]. I want a plot the matrices along horizontal x-axis and their corresponding value on y-axis as shown in figure.

2 ビュー (過去 30 日間)
  5 件のコメント
Image Analyst
Image Analyst 2018 年 10 月 13 日
My answer below should still work. Did you even try it?
dpb
dpb 2018 年 10 月 13 日
What the content of the arrays is is immaterial; what we don't know and you seemingly won't tell us, is anything about the source of these arrays--are they on disk, result of some calculation, a series of simulations, maybe based on the last comment...???
As IA says, "try SOMETHING and show us what isn't what you expect", don't make somebody trying to help you figure out what it is that you need help with or are trying to do...
You don't say what you want to do along this x-axis; and what happens to the x-axis values in each -- does it expand, do you have real time or just sample number, etc., etc., etc., ...

サインインしてコメントする。

採用された回答

Image Analyst
Image Analyst 2018 年 10 月 12 日
編集済み: Image Analyst 2018 年 10 月 12 日
Try this:
for k = 1 : 2000
thisMatrix = GetMatrixSomehow(k);
y(k) = GetValueSomehow(thisMatrix);
end
plot(y, 'b-', 'LineWidth', 2);
grid on;
xlabel('Matrix Number', 'FontSize', 20);
ylabel('y', 'FontSize', 20);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by