1. Matlab Trouble

hello, I am having some difficulties in runing this script:
p(1)=0.5;
q(1)=0.5;
n(1)=0.5;
k(1)=0.5;
I(1)=p(1)*n(1);
II(1)=p(1)*k(1);
III(1)=q(1)*n(1);
IV(1)=q(1)*k(1);
W(1)=I(1)+II(1)+III(1)+IV(1);
for j=1:3:10
f=0+j*0.1;
for d=1:1:4
h=d*0.5;
for z=1:2:11
T=z-0.2;
for i=1:20
W(i+1)=I(i)+II(i)+III(i)+IV(i);
R(i)=(1/(II(i)*III(i)*0.25+III(i)*I(i)*0.5+I(i)*IV(i)*0.25 +(III(i))^2+III(i)*IV(i)*0.5));
s(i)=h*(II(i)*III(i)*0.25+III(i)*I(i)*0.5+I(i)*IV( i)*0.25)+((III(i))^2+III(i)*IV(i)*0.5);
I(i+1)=(1/W(i+1))*(I(i)/(W(i))*(1-T)+p(i)*n(i)*h);
II(i+1)=(1/W(i+1))*(II(i)/(W(i))*(1-T)+p(i)*k(i)*h);
III(i+1)=(1/(W(i+1))*(III(I)*(1/W(i))+q(i)*n(i)*s(i)*R(i)));
L(i)=(1/(IV(I)*III(i)*0.5+(IV(i))^2+IV(i)*II(i)*0.5+IV(i)* I(i)*0.25+III(i)*II(i)*0.25));
Y(i)=h*(IV(i)*II(i)*0.5+IV(i)*I(i)*0.25+III(i)*II( i)*0.25)+(IV(I)*III(i)*0.5+(IV(i))^2);
IV(i+1)=(1/W(i+1))*((IV(i)*(1/W(i)))+f*q(i)*k(i)*Y(i)*L(i));
P(i+1)=I(i+1)+II(i+1);
n(i+1)=I(i+1)+III(i+1);
q(i+1)=III(i+1)+IV(i+1);
K(i+1)=II(i+1)+IV(i+1);
end
end
end
end
x=(1:i+1);
figure(100*j+10*d+z)
plot(x,I,x,II,x,III,x,IV);
xlabel(
'generation ');ylabel('population');

It keeps giving me the error :??? Undefined function or method 'New' for input arguments of type 'char'.
Why?What have I done wrong?
any assistance would be most appriciated.
Thanks

2. Originally Posted by Rorshach
hello, I am having some difficulties in runing this script:
p(1)=0.5;
q(1)=0.5;
n(1)=0.5;
k(1)=0.5;
I(1)=p(1)*n(1);
II(1)=p(1)*k(1);
III(1)=q(1)*n(1);
IV(1)=q(1)*k(1);
W(1)=I(1)+II(1)+III(1)+IV(1);
for j=1:3:10
f=0+j*0.1;
for d=1:1:4
h=d*0.5;
for z=1:2:11
T=z-0.2;
for i=1:20
W(i+1)=I(i)+II(i)+III(i)+IV(i);
R(i)=(1/(II(i)*III(i)*0.25+III(i)*I(i)*0.5+I(i)*IV(i)*0.25 +(III(i))^2+III(i)*IV(i)*0.5));
s(i)=h*(II(i)*III(i)*0.25+III(i)*I(i)*0.5+I(i)*IV( i)*0.25)+((III(i))^2+III(i)*IV(i)*0.5);
I(i+1)=(1/W(i+1))*(I(i)/(W(i))*(1-T)+p(i)*n(i)*h);
II(i+1)=(1/W(i+1))*(II(i)/(W(i))*(1-T)+p(i)*k(i)*h);
III(i+1)=(1/(W(i+1))*(III(I)*(1/W(i))+q(i)*n(i)*s(i)*R(i)));
L(i)=(1/(IV(I)*III(i)*0.5+(IV(i))^2+IV(i)*II(i)*0.5+IV(i)* I(i)*0.25+III(i)*II(i)*0.25));
Y(i)=h*(IV(i)*II(i)*0.5+IV(i)*I(i)*0.25+III(i)*II( i)*0.25)+(IV(I)*III(i)*0.5+(IV(i))^2);
IV(i+1)=(1/W(i+1))*((IV(i)*(1/W(i)))+f*q(i)*k(i)*Y(i)*L(i));
P(i+1)=I(i+1)+II(i+1);
n(i+1)=I(i+1)+III(i+1);
q(i+1)=III(i+1)+IV(i+1);
K(i+1)=II(i+1)+IV(i+1);
end
end
end
end
x=(1:i+1);
figure(100*j+10*d+z)
plot(x,I,x,II,x,III,x,IV);
xlabel(
'generation ');ylabel('population');

It keeps giving me the error :??? Undefined function or method 'New' for input arguments of type 'char'.
Why?What have I done wrong?
any assistance would be most appriciated.
Thanks
When you run the script and generate the error message there will be a line number. When you click on the error message it will take you to the line with the error.

.