Borrar filtros
Borrar filtros

Subscripted assignment dimension mismatch

1 visualización (últimos 30 días)
seprienna
seprienna el 30 de En. de 2015
Comentada: seprienna el 30 de En. de 2015
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

Respuestas (1)

Andreas Goser
Andreas Goser el 30 de En. de 2015
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 comentario
seprienna
seprienna el 30 de En. de 2015
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;

Iniciar sesión para comentar.

Categorías

Más información sobre Resizing and Reshaping Matrices en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by