Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

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

조회 수: 2 (최근 30일)
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?

답변 (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