Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Why this for does not avance to the second CSV

1 vue (au cours des 30 derniers jours)
Tony Castillo
Tony Castillo le 22 Oct 2020
Clôturé : Rik le 22 Oct 2020
Hi all,
I am working with the extraction of a csv column, and removin NaN, and later I try to accumulate in an array because this procedure has to be done for 12 months, but the script do not acumulate the second execution, do you know what is it wrong?
%%%%Leer y extraer datos de una CSV
current_path = pwd;
close all
Irr_=ones(25,1);
for Dailydata_i=1:2
T = readtable('Dailydata_1.csv', 'PreserveVariableNames', true);
%
I=T(:,3);
A=table2array(I); %%%%%a
Irr=A(1:25);
Irr(isnan(Irr))=0;
M=max(Irr);
m=mean(Irr);
size(Irr);
Irr_=[Irr_];
cd(current_path);
end
z=ones(25,2); %%
I2=([Irr_].*z);
  1 commentaire
Rik
Rik le 22 Oct 2020
If you would use the smart indentation, you would notice that you've put the cd inside your loop. Luckily it does nothing, as you didn't change the current directory (nor should you: readtable allows you to specify a full or relative path).
Where are you specifying any acumulation? Where did you specify the second file name? You need to tell Matlab what it should do.

Réponses (0)

Cette question est clôturée.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by