file extraction...error.

hi i am running this code and getting this error for some reason.can anybody help why???
d = dir('*.xls'); N_File = numel(d); % no of files present in the folder for same class
for num = 1:N_File
k = fullfile(d(num).name);
[~,~,dat] = xlsread(d(num).name);
C = [C;num2cell(num*ones(size(dat,1),1)),dat];
end
??? [~,~,dat] = xlsread(d(num).name); | Error: Expression or statement is incorrect--possibly unbalanced (, {, or [.

댓글 수: 1

Walter Roberson
Walter Roberson 2011년 12월 15일
http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup

댓글을 달려면 로그인하십시오.

 채택된 답변

Walter Roberson
Walter Roberson 2011년 12월 15일

0 개 추천

Your version of MATLAB is probably too old to support using ~ in assignments.
Change
[~,~,dat] = xlsread(d(num).name);
to
[unneeded1,unneeded2,dat] = xlsread(d(num).name);

댓글 수: 1

karan
karan 2011년 12월 15일
Yes does not work on matlab 2009a but works on matlab 2010a.
Thank you.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

질문:

2011년 12월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by