vectors must be same length

조회 수: 3 (최근 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 CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by