Import multiple CSV files then use a loop to find the peaks in each

1 回表示 (過去 30 日間)
Boris Chan
Boris Chan 2018 年 11 月 20 日
コメント済み: Stephen23 2018 年 11 月 20 日
Hi,
I need to import about 60 csv files with 10002x3 in each, then plot the peaks for each one of them
I tried this
d = dir('*.csv');
for i = 1:length(d)
data{i} = csvread(d(i).name);
end
but It didn't work just says error in line with the data{i}
I tried importing a couple manually but I realized it made them into seperate variables and it woulldn't be easy to loop them.
for i = 0:30
xx{i} = x600_i{:,1};
yy{i} = x600_i{:,3};
end
where all my variables are named x600_0-10
  3 件のコメント
KSSV
KSSV 2018 年 11 月 20 日
What error it showed? How is your csv file?
Stephen23
Stephen23 2018 年 11 月 20 日
"but It didn't work just says error in line with the data{i}"
And is that helpful error message going to remain a secret, or are you going to tell us the message so that we can actually help you? Please give us the complete message text. This means all of the red text.

サインインしてコメントする。

回答 (1 件)

madhan ravi
madhan ravi 2018 年 11 月 20 日
編集済み: madhan ravi 2018 年 11 月 20 日
xx{i}=sprintf('x600_i{:,1}',i) %where i is from 0 - 10

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by