Error "Matrix dimensions must agree" what should I fix?

3 ビュー (過去 30 日間)
mohsen
mohsen 2016 年 3 月 17 日
編集済み: Stephen23 2016 年 3 月 17 日
a = 0.25;
theta = 0;
r = [0:12];
x = (30/2)*((1-(a^2/r.^2))+(1+3*(a^4/r.^4)-4*(a^2/r.^2)*cos(2*theta)))
y = (30/2)*((1+(a^2/r.^2))-(1+3*(a^4/r.^4)*cos(2*theta)))
z = -(30/2)*((1-3*(a^4/r.^4)+2*(a^2/r.^2))*sin(2*theta))
figure(1)
plot(x)
figure(2)
plot(y)
figure(3)
plot(z)
  1 件のコメント
Stephen23
Stephen23 2016 年 3 月 17 日
編集済み: Stephen23 2016 年 3 月 17 日
@Abdulmohsen Bahabri: today I formatted your code correctly for you. In future you can do it yourself by selecting the code text and clicking the {} Code button.

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

採用された回答

KSSV
KSSV 2016 年 3 月 17 日
編集済み: Stephen23 2016 年 3 月 17 日
a = 0.25;
theta = 0;
r = [0:12];
x = (30/2)*((1-(a^2./r.^2))+(1+3*(a^4./r.^4)-4*(a^2./r.^2)*cos(2*theta))) ;
y = (30/2)*((1+(a^2./r.^2))-(1+3*(a^4./r.^4)*cos(2*theta))) ;
z = -(30/2)*((1-3*(a^4./r.^4)+2*(a^2./r.^2))*sin(2*theta)) ;
figure (1)
plot(x)
figure (2)
plot(y)
figure (3)
plot(z)
element by element division.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePrinting and Saving についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by