i have two arrays in matlab code and i want to plot them by two lines on the same graph

95 ビュー (過去 30 日間)
Momen AlManaseh
Momen AlManaseh 2021 年 7 月 10 日
編集済み: Soniya Jain 2021 年 7 月 10 日
i have two arrays in matlab code and i want to plot them by two lines on the same graph

回答 (1 件)

Soniya Jain
Soniya Jain 2021 年 7 月 10 日
You can use plot function,
plot(Array1);
hold on;
plot(Array2);
hold off;
hold will retain current plot when adding new plots.
  4 件のコメント
Momen AlManaseh
Momen AlManaseh 2021 年 7 月 10 日
no, i dont plotting empty array. the idea is define an empty array then should be filling during function. finally, plot this array after filling.
Soniya Jain
Soniya Jain 2021 年 7 月 10 日
編集済み: Soniya Jain 2021 年 7 月 10 日
I guess you are trying to plot cell array as using {}, which is invalid argument in plot function, so you can first covert cell array to vector using or str2double functions, and then try plotting.

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

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by