Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

How to variably name a loaded file from matrix cells

1 vue (au cours des 30 derniers jours)
M
M le 31 Déc 2013
Clôturé : MATLAB Answer Bot le 20 Août 2021
SI = ['MD' 'RA' 'FA' 'e1' 'e2' 'e3' 'SK' 'LA' 'AA' 'VR' 'DV' 'Cl' 'Cp' 'Cs']; %Scalar Indices
CA = ['Otsu' 'K-means' 'EM' 'ICM' 'FCM']; %Clustering Algo
for i=1:5
for j=1:15
if (j<10)
fname = ['..\Data_Out\', CA(i),'_',SI(j), '_0', j,'.DAT'];
else
fname = ['..\Data_Out\', CA(i),'_',SI(j), '_', j,'.DAT'];
end
File_XX = fopen(fname);
File_SI = File_XX;
IMG = fread(File_SI, '*float');
fclose(File_SI);
IMG = reshape(IMG,256,256,50);
.
.
.
I know my problem is pretty naive, but I don't know how to fix it.
I have the above mentioned code and the variable loading loading file doesn't want to work, although it worked with other people.
Any ideas??
  1 commentaire
Jan
Jan le 31 Déc 2013
CA = ['Otsu' 'K-means' 'EM' 'ICM' 'FCM'];
This will not produce, what you expect. It creates the string:
CA = 'OtsuK-meansEMICMFCM'
Use a cell string, if you want to store a list of strings. See help cell.

Réponses (1)

Walter Roberson
Walter Roberson le 31 Déc 2013

Community Treasure Hunt

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

Start Hunting!

Translated by