Help with an error
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hello,
I want to ask you how can I solve such an error.
The thing is I want a 2-D array that grows.
x has a length n and is a column vector
L is an nxn vector
this is the prototype of the code.
I cant figure out a way to solve such a question
function [Nt,xe,ye]= PopulationProgress(x,L)
%x=[200000,300000,500,1500]'
i=0;
n=length(x);
Nt=Zeros(n,3);
Nt(:,1)=x;
Nt(:,2)=L*Nt(:,1);
while Nt(:,i)= Nt(:,i+1)
i=i+1;
Nt(:,i)=L*Nt(:,i-1);
Nt(:,i+1)=L*Nt(:,i);
end;
ye=i;
xe=Nt(:,i);
Thank you for any suggestions
Best
0 comentarios
Respuesta aceptada
Srinivas
el 1 de Mzo. de 2012
MATLAB is case sensitive, replace your
Nt = zeros(n,3)
i = 1,
MATLAB does not allow indices to be '0';
0 comentarios
Más respuestas (1)
Walter Roberson
el 1 de Mzo. de 2012
In your "while" statement, you need to use "==" rather than "="
Ver también
Categorías
Más información sobre Number Theory en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!