n =10;
t = zeros(1:n);
pa = zeros(1:n);
tf = 120;
for i = 1:n
t(i) = (i-1)*tf/(n-1);
pu(i) = pini*tv/(380 + wf*t(i)/60);
end
plot(t,pa);
I get the error :
Error using plot
Data cannot have more than 2 dimensions.
Thanks

 採用された回答

Adam Danz
Adam Danz 2019 年 7 月 30 日
編集済み: Adam Danz 2019 年 7 月 30 日

1 投票

The 3 lines below create two 10 dimensional arrays. plot(x,y) only allows for scalars, vectors, or matrices.
n =10;
t = zeros(1:n);
pa = zeros(1:n);
You probably meant
t = zeros(1,n);
pa = zeros(1,n);
But since we don't have values for many of the other variables, we can't test it.

3 件のコメント

Adam Danz
Adam Danz 2019 年 7 月 30 日
編集済み: Adam Danz 2019 年 7 月 30 日
"Thanks for your patient answer - yes t,a and pu are simple vectors - so that is what I meant. "
Does that solve your problem? I'd be glad to help more if you provide values so I can run your code.
Stephen23
Stephen23 2019 年 7 月 30 日
Ambady Suresh 's incorrectly accepted "Answer" moved here:
Thanks for your patient answer - yes t,a and pu are simple vectors - so that is what I meant.
Adam Danz
Adam Danz 2019 年 7 月 30 日
Thanks, Stephen!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

製品

リリース

R2018b

タグ

質問済み:

2019 年 7 月 30 日

コメント済み:

2019 年 7 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by