Azzera filtri
Azzera filtri

Subscripted assignment dimension mismatch

1 visualizzazione (ultimi 30 giorni)
seprienna
seprienna il 30 Gen 2015
Commentato: seprienna il 30 Gen 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

Risposte (1)

Andreas Goser
Andreas Goser il 30 Gen 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 Commento
seprienna
seprienna il 30 Gen 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;

Accedi per commentare.

Categorie

Scopri di più su Resizing and Reshaping Matrices in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by