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 件のコメント

Rena Berman
Rena Berman 2017 年 3 月 23 日
(Answers Dev) Restored edit
Brandon Phillips
Brandon Phillips 2017 年 3 月 23 日
Question has been edited and reposted
Jan
Jan 2017 年 3 月 23 日
@Brandon: Please don't do this. Adding new information to a question is welcome, but removing details is disliked.
Rena Berman
Rena Berman 2017 年 3 月 27 日
(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 日

0 投票

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 ExchangeGraphics 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