필터 지우기
필터 지우기

Info

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

How can iget over this error message "Matrix dimensions must agree'. i am trying to obtain the value of w1, 2,3,4.

조회 수: 1 (최근 30일)
rx = r*cosd(psi);
ry = r*sind(psi);
r1_half2 = sqrt(power(b/2-ry,2)+power(rx-t/2,2));
r2_half2 = sqrt(power(b/2-ry,2)+power(rx+t/2,2));
r3_half2 = sqrt(power(b/2+ry,2)+power(rx-t/2,2));
r4_half2 = sqrt(power(b/2+ry,2)+power(rx+t/2,2));
theta = [theta_half1 0 theta_half2];
r1 = [r1_half1 -psi r1_half2];
r2 = [r2_half1 -psi r2_half2];
r3 = [r3_half1 psi r3_half2];
r4 = [r4_half1 psi r4_half2];
rmsws=input('rmsws');
rmsr = power((power(rx,2)+power(ry,2)+0.25*(t*t+b*b)),0.5);
w1 = rmsws*(r1./rmsr);
w2 = rmsws*(r2./rmsr);
  댓글 수: 1
Ameer Hamza
Ameer Hamza 2020년 9월 11일
Dimensions of r1 are 1x3, whereas the dimensions of rmsr are not obvious, but it seems to be the same as size(psi). These two dimensions do not match, so you cannot divide the elements of these two vectors.

답변 (1개)

Monisha Nalluru
Monisha Nalluru 2020년 9월 15일
The reason for above error is mistach of matrix size.
While performing a dot divison operation the matrix size should match
check the size of two matrixes using size function
a=size(r1);
b=size(rmsr);
% a should be equal to b

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by