Error using plot Vectors must be the same length.

1 回表示 (過去 30 日間)
Muhammed Çevik
Muhammed Çevik 2020 年 12 月 26 日
編集済み: Muhammed Çevik 2020 年 12 月 30 日
Hi everyone,
I want to add the number m to the K array after 25 loops. But I have some problems with K array. How can I fix that problem?
function ButtonPushed(app, event)
plot(app.UIAxes2,0:200,K); %Error using plot Vectors must be the same length.
% I decreased and increased 200 but didn't work.
end

採用された回答

Ive J
Ive J 2020 年 12 月 26 日
編集済み: Ive J 2020 年 12 月 26 日
The error is quite clear, 0:200 size doesn't match that of K. numel(0:200) is 201 while numel(K) is 199. It's better to replace if with
plot(0:numel(K)-1, K)
  1 件のコメント
Muhammed Çevik
Muhammed Çevik 2020 年 12 月 26 日
Thank you so much .It works great.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by