Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Why this for does not avance to the second CSV

1 回表示 (過去 30 日間)
Tony Castillo
Tony Castillo 2020 年 10 月 22 日
閉鎖済み: Rik 2020 年 10 月 22 日
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 件のコメント
Rik
Rik 2020 年 10 月 22 日
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.

回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by