MATLAB: Help on string in .m file 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 Best Answer Nfiles = 100; for i = 1:Nfiles matfile = ['B0E ' int2str(i)]; load(matfile) eval(['f' int2str(i) '(:, :, 1) = c' int2str(i) '(:, :, 1);']) end Related SolutionsMATLAB: Input prompt for i=1:30g=input(['enter ' int2str(i) ' th line']);end MATLAB: MAT files p=load matfile1.matq=load matfile2.matsave newmatfile.mat Related QuestionLoading indexed .mat files using a for loopFunctions for finding values‘horzcat’ error when using dicomread() within a for-loopHow to read datafiles residing in a different path than the program using the ‘load’ command or otherwise
Best Answer