Help on string in .m file

조회 수: 1 (최근 30일)
keith lin
keith lin 2013년 2월 12일
I want something like this below without doing it 100x times please help!
load B0E1.mat f1(:,:,1) = c1(:,:,1)
load B0E2.mat f2(:,:,1) = c2(:,:,1)
load B0E3.mat f3(:,:,1) = c3(:,:,1)
load B0E4.mat f4(:,:,1) = c4(:,:,1)
etc.. till b0e100

채택된 답변

Thorsten
Thorsten 2013년 2월 12일
Nfiles = 100;
for i = 1:Nfiles
matfile = ['B0E ' int2str(i)];
load(matfile)
eval(['f' int2str(i) '(:, :, 1) = c' int2str(i) '(:, :, 1);'])
end
  댓글 수: 1
keith lin
keith lin 2013년 2월 12일
Thank you very much.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by