Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Error "Inner matrix dimensions don't agree" I used the element wise operator but I still have the same error

2 ビュー (過去 30 日間)
mohsen
mohsen 2016 年 9 月 8 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
F = [-40:20:40];
x = [0:0.1:0.8]
y = [0:0.1:0.4]
sigma_p = F./(x.*y)
sigma_mx = (F.*y)./(1./12.*(x).*(y).^3);
sigma_my = (F.*x)./(1./12.*(y).*(x).^3);
sigma_net = sigma_p + sigma_mx + sigma_my;
mesh (x,y,sigma_net)
  2 件のコメント
James Tursa
James Tursa 2016 年 9 月 8 日
F and y have 5 elements, but x has 9 elements, so how is x.*y supposed to even work? Are you trying to get results for all possible combinations of x and y and F? Or what?
mohsen
mohsen 2016 年 9 月 8 日
Yes I think so what should I fix

回答 (2 件)

Image Analyst
Image Analyst 2016 年 9 月 8 日
編集済み: Image Analyst 2016 年 9 月 8 日
Perhaps you want to use the linspace() function instead of the colon operator to make sure all vectors are the same length.
F = linspace(-40,40, 9);
x = linspace(0, 0.8, 9);
y = linspace(0, 0.4, 9);

Image Analyst
Image Analyst 2016 年 9 月 9 日

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by