plot corresponding rows of 2 matrices

2 ビュー (過去 30 日間)
MatG
MatG 2020 年 9 月 8 日
回答済み: madhan ravi 2020 年 9 月 8 日
Is there an easy way to use plot, or a similar plottign command, to plot rows of matrix X as x value vs rows of matrix Y as y value?
x=[1 2 3 4;1.5 2 3.4 4.3];
y=2*[1 2 3 4;1.5, 2 3.4, 4.3];
% I want to replace the following for loop
for i = 1:siz(x,1)
plot(x(i,:),y(i,:));hold on;
end

採用された回答

madhan ravi
madhan ravi 2020 年 9 月 8 日
plot(x.', y.')

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by