I need help in plotting the data but I keep getting an error

I get the rolling when I run the code
Error using plot Vectors must be the same length.
Error in untitled8 (line 80) subplot(2,1,1),plot(t,position)

댓글 수: 4

(Answers Dev) Restored edit
Question has been edited and reposted
@Brandon: Please don't do this. Adding new information to a question is welcome, but removing details is disliked.
(Answers Dev) Restored edit

댓글을 달려면 로그인하십시오.

 채택된 답변

ES
ES 2017년 3월 23일

0 개 추천

What is the length of t and position?? Both must be of same length if you want to plot them..

추가 답변 (1개)

Walter Roberson
Walter Roberson 2017년 3월 23일
In most places in your code you use position as a pre-allocated 3 x n array. But in the "for t" loop as well as doing that you also have
position = [w(1);w(2);w(3)];
which overwrites all of position with a vector of length 3.

카테고리

도움말 센터File Exchange에서 Graphics Performance에 대해 자세히 알아보기

질문:

2017년 3월 23일

댓글:

2017년 3월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by