loading excel cell in matlab
古いコメントを表示
Hey
I am facing the 'Index exceeds matrix dimensions' Error while using xlsread
[WL_time,dummy1,dummy2]=xlsread(WL_data(nn).name,1,'B8')
Its in a for loop and nn is the counter, I define 'WL_data' as
WL_data=dir('*.xlsx')
Index exceeds matrix dimensions.
Error in Unsteady_fm50hz_150sec (line 51)
[WL_time,dummy1,dummy2]=xlsread(WL_data(nn).name,1,'B8');
I would be glad if you help me
9 件のコメント
Alex Mcaulley
2019 年 6 月 18 日
How are you implementing the nn loop?
for nn = 1:numel(WL_data) %??
Try debugging your code putting a breakpoint inside the loop to see what is happening.
Alex Mcaulley
2019 年 6 月 18 日
How do you count the number of excel files? How you define N1?
mehra
2019 年 6 月 18 日
Alex Mcaulley
2019 年 6 月 18 日
This should work. Try debugging your code to see why it is happening. Without the full code is difficult to guess it.
Alex Mcaulley
2019 年 6 月 18 日
At least the code inside the loop is needed to go further. It seems to be an error in
WL_data(nn).name
A simple check is to see if N1 is the total number of xlsx files in your folder.
Walter Roberson
2019 年 6 月 18 日
編集済み: Walter Roberson
2019 年 6 月 18 日
Your file loaded via load(vel_data(nn).name) contains a variable named nn that is overriding the for nn loop value
You should avoid using load without an output variable:
datastruct = load(vel_data(nn).name);
Data = datastruct.Data;
mehra
2019 年 6 月 18 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Data Import from MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!