Effacer les filtres
Effacer les filtres

Help on string in .m file

1 vue (au cours des 30 derniers jours)
keith lin
keith lin le 12 Fév 2013
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

Réponse acceptée

Thorsten
Thorsten le 12 Fév 2013
Nfiles = 100;
for i = 1:Nfiles
matfile = ['B0E ' int2str(i)];
load(matfile)
eval(['f' int2str(i) '(:, :, 1) = c' int2str(i) '(:, :, 1);'])
end
  1 commentaire
keith lin
keith lin le 12 Fév 2013
Thank you very much.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Graphics Object Programming dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by