필터 지우기
필터 지우기

Subscripted assignment dimension mismatch

조회 수: 1 (최근 30일)
seprienna
seprienna 2015년 1월 30일
댓글: seprienna 2015년 1월 30일
to any kind folks, pls help me to find a solution the the error below: Subscripted assignment dimension mismatch. your kind help is greatly appreciated
for a =1:30
for P=1:1
o=(P-1)*30;
for r=1:2
if r==2
t=-4;
pA1(1:13+t,1:13+t,r,P)=A(17*r-16+o:17*r+t+o,1:17+t); <-- error begins here
pB1(1:13+t,1,r,P)=B(17*r-16+o:17*r+t+o,1:17+t);
beta(r,P)=A(17*r-16+o:17*r+t+o,a)\B(17*r-16+o:17*r+t+o,a);
else
t=0;
pA(1:13+t,1,r,P)=A(17*r-16+o:17*r+t+o,a);
pB(1:13+t,1,r,P)=B(17*r-16+o:17*r+t+o,a);
beta(r,P)=A(17*r-16+o:17*r+t+o,a)\B(17*r-16+o:17*r+t+o,a);
end
end
end
end

답변 (1개)

Andreas Goser
Andreas Goser 2015년 1월 30일
This cannot be run:
Undefined function 'A' for input arguments of type 'double'.
Error in xxx (line 13) pA(1:13+t,1,r,P)=A(17*r-16+o:17*r+t+o,a);
Need to speculate. When the first error comes it calls A(1:13,1:13). You can find out if A has those sizes.
  댓글 수: 1
seprienna
seprienna 2015년 1월 30일
i'm trying to create a partition for 25 x 30 , 1st-17 2nd-13 my A is 17x17 how can i create 2 beta ( 17x17 & 13x13) please advise the way forward.thank you
A=randi(20,25,30); % creating random A
beta_r = randi(10,30,30); % creating random beta
B = A*beta_r;

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

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by