필터 지우기
필터 지우기

Matrix dimensions must agree.

조회 수: 3 (최근 30일)
hamed
hamed 2016년 8월 17일
댓글: hamed 2016년 8월 17일
Hello Dears
I have a 3D matrix like this:
H1([3,4,5,6,7,8],1,6)=1;
So, I defined a variable c like:
c=1000*ones(12,1);
When I use the varıable c, I get the error as follow:
Matrix dimensions must agree.
How should I define the variable c to meet 3D matrix?
Thanks
  댓글 수: 2
Azzi Abdelmalek
Azzi Abdelmalek 2016년 8월 17일
What is the meaning of to meet?
Azzi Abdelmalek
Azzi Abdelmalek 2016년 8월 17일
How did you use c?

댓글을 달려면 로그인하십시오.

채택된 답변

Thorsten
Thorsten 2016년 8월 17일
c = 1000*ones(size(H1));
  댓글 수: 1
hamed
hamed 2016년 8월 17일
Thanks for your Answer
I revised my code but I have another problem.
I have this line:
z1=bsxfun(@times,(maxc/r),ones(l,r,h3));
also z2 is created according to z1:
z2=zeros(l,r,h3);
The other variable is Cindex:
*Cindex=(i-1)*path+j;*
When I want to write the bellow code:
z2(Cindex)=maxc-1e-8;
I encounter to this error:
In an assignment A(:) = B, the number of elements in A and B must be the same.
Bests

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by