필터 지우기
필터 지우기

assigning a variable name with prefix from a loop read to an array

조회 수: 3 (최근 30일)
Philip
Philip 2014년 7월 10일
댓글: José-Luis 2014년 7월 10일
for j=109:110 % create a filename for loop read ExcelFileName = sprintf('%d_IF.csv', j); ExcelSheetName = sprintf('%d_IF',j); % Mod_IF = xlsread(ExcelFileName,ExcelSheetName,'B22:B100021'); % end % what I want to do is read in 109_IF.csv, 109_IF sheet from B22 to B100021 % As far as I can tell that is occuring because I can look at Mod_IF and % it has the correct values. % % I would like to save the data into Mod_IF_109 on the first loop % and then save the data on the second read into Mod_IF_110 and so on % % I have not found a way to do that, I have tried eval, S., newname % and so on, but each time I tried to access the data outside the % loop an error occurs that says function or variable Mod_IF_109 is undefine % and I do not see Mod_IF_109 array in the workspace being created. % % Looking at the FAQs and the other have, the solutions are close % but I have not been able to get them to get past the error, in fact % the above came from a FAQ but the FAQ did not elaborate on how to % save the data into an array that is identified by the j value. % % Using a multi-column array is NOT an option i.e (10000x(number of % reads in the loop) for various reasons % Thanks for any advance %Regards %Philip
  댓글 수: 3
Philip
Philip 2014년 7월 10일
Yes, I have edited the question sorry I did not look at the preview before submitting, thanks. Regards, Philip
José-Luis
José-Luis 2014년 7월 10일
I'm sorry but you haven't.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by