Borrar filtros
Borrar filtros

not getting the output

3 visualizaciones (últimos 30 días)
Abhijit Sardar
Abhijit Sardar el 27 de Dic. de 2020
Editada: Walter Roberson el 27 de Dic. de 2020
my code is running but i am unable to obtain output variables value(A nad B).This is my code
m = load('c12.5_17day_1a.TXT');
u = cumsum (m(:,1));
new = [m u];
N = new(:,20);
for i=1:length(N)
if(N<50)
j=1;
elseif(N>50)
j=50;
A = (1/j)* movesum(m(:,18),m(:,1),m(:,j));
end
if(N<=50)
k=1;
elseif((51<= N)&(N <=200))
k=N-30;
elseif((201<= N)&(N<=500))
k=0.85*N;
elseif(N >=501)
k = N-75;
B = ((N(i)/(N(i)-k))) * (movesum(m(:,18),m(:,k+1),m(:,N(i))))/(movesum(m(:,18),m(:,1),m(:,N(i)))) ;
end
end

Respuestas (1)

Walter Roberson
Walter Roberson el 27 de Dic. de 2020
Editada: Walter Roberson el 27 de Dic. de 2020
N = new(:,20);
N is a vector
for i=1:length(N)
if(N<50)
You are testing a vector. You should be testing N(i)
You should be writing to A(i) and B(i)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by