Help with loop or alternative solution

5 ビュー (過去 30 日間)
BOB
BOB 2014 年 5 月 11 日
コメント済み: BOB 2014 年 5 月 12 日
I have 90 seperate .csv files. I need to read these into matlab and then use the data.
All of the files are called 'Trial01.csv', 'Trial02.csv' to 'Trial90.csv'.
I'm trying to make a loop, so that it reads from one .csv file performs the actions, then reads in the next but I am struggling to do so.
After getting the data from these I also need to save it somehwere and I'm not sure where/how to do this.
So far I have this code:
nsub=90; %Number of tests
for i=1:nsub
Sub1CMJ=xlsread('Trial01.csv','D2790:D6005')
Num0=find(Sub1CMJ==0);%How many 0 readings = time in air
FT=length(Num0)*0.001; %Time of flight
g=-9.81
pk_disp=(0*(FT/2))-(0.5*g*(FT/2)^2); %Peak Jump Height using vt-0.5*a*t^2
end
Any help would be greatly appreciated.
Thanks

回答 (3 件)

per isakson
per isakson 2014 年 5 月 11 日

BOB
BOB 2014 年 5 月 11 日
I've tried that and it didn't help
  1 件のコメント
per isakson
per isakson 2014 年 5 月 11 日
編集済み: per isakson 2014 年 5 月 11 日
You need to be more specific. What have you done? What specific problems do you encounter?

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


BOB
BOB 2014 年 5 月 11 日
I'm just struggling to make it loop round. It works for the first file, but I can't get it to then read in the second file afterwards and so on. BAsically I want it to read in the first file, do the equations, give me the outputs and save them, and then read in the second file and do it all again. for 90 files.
thanks
  4 件のコメント
per isakson
per isakson 2014 年 5 月 11 日
You need to be more specific. What have you done? What specific problems do you encounter?
BOB
BOB 2014 年 5 月 12 日
I NEED IT TO LOOP AND I CAN'T DO IT.
please help

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

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by