Have a problem on my code could you help me? URGENT

1 回表示 (過去 30 日間)
Gerard Nava
Gerard Nava 2018 年 5 月 26 日
コメント済み: Walter Roberson 2018 年 5 月 26 日
a2=28
ctheta3=cos(1:1:360)
stheta3=sin(1:1:360)
a3=39
stheta2=sin(1:1:360)
ctheta2=cos(1:1:360)
s=(a2*ctheta2)+(a3*ctheta3)
e=-((a2*stheta2)+(a3*stheta3))
subplot(3,2,1),plot(s,'c'),xlabel('Posición'),ylabel('Tiempo'),title('Grafica de posición s','FontSize',12)
subplot(3,2,2),plot(e,'r'),xlabel('Posición de e'),ylabel('Tiempo'),title('Grafica de posición e','FontSize',12)
DCt3=diff(ctheta3)
DSt3=diff(stheta3)
DCt2=diff(ctheta2)
DSt2=diff(stheta3)
W3=(a2*DCt2)./(a3*ctheta3)
subplot(3,2,3),plot(W3,'g'),xlabel('Velocidad de theta3'),ylabel('Tiempo'),title('Grafica de velocidad angular de theta3','FontSize',12)
Matrix dimensions must agree.
my problem is when i want to get W3 from the math equations!
  3 件のコメント
Image Analyst
Image Analyst 2018 年 5 月 26 日
No, don't double space code to get it to properly format. Highlight it and THEN click the {}Code icon:

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

採用された回答

Image Analyst
Image Analyst 2018 年 5 月 26 日
Usually with diff() people prepend a zero
DCt2 = [0, diff(ctheta2)]
  1 件のコメント
Gerard Nava
Gerard Nava 2018 年 5 月 26 日
You Are Awesome , Thanks A lot ! , Wish you the best !

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

その他の回答 (1 件)

Gerard Nava
Gerard Nava 2018 年 5 月 26 日
In DCt2 i have 359 elements and in ctheta3 i have 360 elements, how do i arrange the elemnts in 359 in order to be 360, should i add a 1 in its matrix ?, if so , how fo i write that part of the code of DCt2

カテゴリ

Help Center および File ExchangeMathematics and Optimization についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by