Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 1-by-15. – can’t find what the problem is
I keep getting this error, but I have no idea what’s causing it.
Using the step button brings up nothing until the very end when it tries to finish.
all of the X’s,Z’s,Y’s within Fd are 15×1 with positive integers
Any ideas as to what’s causing this?
Fd=zeros(cap, cap, cap,term); %here is the original matrix I created cap=15 and term=20
…
for tt=19:-1:1
for i=1:cap
for j=1:cap
for k=1:cap
… %for brevity’s sake I’ve ommitted some stuff here that doesn’t seem to be causing issues
Fd(i,j,k,tt)= b*(…
m1*(…
p(y(j),z1(k))*(n1*Fd(xp(i),zp(j),y(k),tt+1) + (1-n1)*Fd(xpp(i),zpp(j),y(k),tt+1))+…
(1-p(y(j),z1(k)))*(n2*Fd(xp(i),z1(j),yg(k),tt+1) + (1-n2)*Fd(xpp(i),z1(j),ygg(k),tt+1)))+…
(1-m1)*(…
p2(y(j),z2(k))*(n1*Fd(xp(i),zd(j),y(k),tt+1) + (1-n1)*Fd(xpp(i),zdd(j),y(k),tt+1))+…
(1-p2(y(j),z2(k)))*(n2*Fd(xp(i),z2(j),yg(k),tt+1) + (1-n2)*Fd(xpp(i),z2(j),ygg(k),tt+1))…
))+…
(1-b)*( …
m2*(…
p(y1(j),z(k))*(n1*Fd(xp(i),zg(j),y1(k),tt+1) + (1-n1)*Fd(xpp(i) ,zgg(j),y1(k),tt+1))+ …
(1-p(y1(j),z(k)))*(n2*Fd(xp(i),z(j),yp(k),tt+1) + (1-n2)*Fd(xpp(i) ,z(j),ypp(k),tt+1)))+ …
(1-m2)*(p(y2(j),z(k))*(n1*Fd(xp(i),zg(j),y2(k),tt+1) + (1-n1)*Fd(xpp(i),zgg(j),y2(k),tt+1))+…
(1-p(y2(j),z(k)))*(n2*Fd(xp(i),z(j),yd(k),tt+1) + (1-n2)*Fd(xpp(i),z(j),ydd(k),tt+1))));
If more code is required, I can certainly provideI keep getting this error, but I have no idea what’s causing it.
Using the step button brings up nothing until the very end when it tries to finish.
all of the X’s,Z’s,Y’s within Fd are 15×1 with positive integers
Any ideas as to what’s causing this?
Fd=zeros(cap, cap, cap,term); %here is the original matrix I created cap=15 and term=20
…
for tt=19:-1:1
for i=1:cap
for j=1:cap
for k=1:cap
… %for brevity’s sake I’ve ommitted some stuff here that doesn’t seem to be causing issues
Fd(i,j,k,tt)= b*(…
m1*(…
p(y(j),z1(k))*(n1*Fd(xp(i),zp(j),y(k),tt+1) + (1-n1)*Fd(xpp(i),zpp(j),y(k),tt+1))+…
(1-p(y(j),z1(k)))*(n2*Fd(xp(i),z1(j),yg(k),tt+1) + (1-n2)*Fd(xpp(i),z1(j),ygg(k),tt+1)))+…
(1-m1)*(…
p2(y(j),z2(k))*(n1*Fd(xp(i),zd(j),y(k),tt+1) + (1-n1)*Fd(xpp(i),zdd(j),y(k),tt+1))+…
(1-p2(y(j),z2(k)))*(n2*Fd(xp(i),z2(j),yg(k),tt+1) + (1-n2)*Fd(xpp(i),z2(j),ygg(k),tt+1))…
))+…
(1-b)*( …
m2*(…
p(y1(j),z(k))*(n1*Fd(xp(i),zg(j),y1(k),tt+1) + (1-n1)*Fd(xpp(i) ,zgg(j),y1(k),tt+1))+ …
(1-p(y1(j),z(k)))*(n2*Fd(xp(i),z(j),yp(k),tt+1) + (1-n2)*Fd(xpp(i) ,z(j),ypp(k),tt+1)))+ …
(1-m2)*(p(y2(j),z(k))*(n1*Fd(xp(i),zg(j),y2(k),tt+1) + (1-n1)*Fd(xpp(i),zgg(j),y2(k),tt+1))+…
(1-p(y2(j),z(k)))*(n2*Fd(xp(i),z(j),yd(k),tt+1) + (1-n2)*Fd(xpp(i),z(j),ydd(k),tt+1))));
If more code is required, I can certainly provide I keep getting this error, but I have no idea what’s causing it.
Using the step button brings up nothing until the very end when it tries to finish.
all of the X’s,Z’s,Y’s within Fd are 15×1 with positive integers
Any ideas as to what’s causing this?
Fd=zeros(cap, cap, cap,term); %here is the original matrix I created cap=15 and term=20
…
for tt=19:-1:1
for i=1:cap
for j=1:cap
for k=1:cap
… %for brevity’s sake I’ve ommitted some stuff here that doesn’t seem to be causing issues
Fd(i,j,k,tt)= b*(…
m1*(…
p(y(j),z1(k))*(n1*Fd(xp(i),zp(j),y(k),tt+1) + (1-n1)*Fd(xpp(i),zpp(j),y(k),tt+1))+…
(1-p(y(j),z1(k)))*(n2*Fd(xp(i),z1(j),yg(k),tt+1) + (1-n2)*Fd(xpp(i),z1(j),ygg(k),tt+1)))+…
(1-m1)*(…
p2(y(j),z2(k))*(n1*Fd(xp(i),zd(j),y(k),tt+1) + (1-n1)*Fd(xpp(i),zdd(j),y(k),tt+1))+…
(1-p2(y(j),z2(k)))*(n2*Fd(xp(i),z2(j),yg(k),tt+1) + (1-n2)*Fd(xpp(i),z2(j),ygg(k),tt+1))…
))+…
(1-b)*( …
m2*(…
p(y1(j),z(k))*(n1*Fd(xp(i),zg(j),y1(k),tt+1) + (1-n1)*Fd(xpp(i) ,zgg(j),y1(k),tt+1))+ …
(1-p(y1(j),z(k)))*(n2*Fd(xp(i),z(j),yp(k),tt+1) + (1-n2)*Fd(xpp(i) ,z(j),ypp(k),tt+1)))+ …
(1-m2)*(p(y2(j),z(k))*(n1*Fd(xp(i),zg(j),y2(k),tt+1) + (1-n1)*Fd(xpp(i),zgg(j),y2(k),tt+1))+…
(1-p(y2(j),z(k)))*(n2*Fd(xp(i),z(j),yd(k),tt+1) + (1-n2)*Fd(xpp(i),z(j),ydd(k),tt+1))));
If more code is required, I can certainly provide matrix array MATLAB Answers — New Questions