vectors must be same length

1 回表示 (過去 30 日間)
androSLO
androSLO 2017 年 1 月 10 日
回答済み: Jan 2017 年 1 月 10 日
Hello,
I got a problem with this error:
Error using plot Vectors must be the same length.
Error in RealniGenerator_student (line 61) plot(t,U)
I have made Real Generator and it works fine. But when i want to plot results it shows this error. How to fix this or how to write plot then that it will work?
Thank you for answers in advance.
  2 件のコメント
Stephen23
Stephen23 2017 年 1 月 10 日
編集済み: Stephen23 2017 年 1 月 10 日
@androSLO: tell us exactly the outputs of these operations:
size(t)
size(U)
Adam
Adam 2017 年 1 月 10 日
編集済み: Adam 2017 年 1 月 10 日
That is one of those errors that really is quite self-explanatory, to be fair! Using the debugger it should be obvious what the problem is.

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

回答 (1 件)

Jan
Jan 2017 年 1 月 10 日
The message is clear: "Vectors must be the same length."
The solution is to provide two array with the same size. Of course if you plot a signal versus the time, both inputs must have the same number of elemens (or the signal is a matrix).

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by