Storing data from for loop
Ältere Kommentare anzeigen
Hi all,
I'm new to Matlab and trying to create a for loop that will save information gathered from a DICOM file into a mtrix for further use. My code so far is as follows...
[FileName PathName] = uigetfile('*.*','Select DICOM File', 'MultiSelect','on');
im1=dicomread([PathName FileName{1}]);
[r c]=size(im1);
I=[];
order=[];
for s=1:length(FileName)
info=dicominfo([PathName FileName{s}]);
order=info.SliceLocation;
I(:,:,s)= [PathName, FileName(s), order]
end
I get the following error when running the code...
Conversion to double from cell is not possible.
Error in Untitled3 (line 11)
I(:,:,s)= [PathName, FileName(s), order]
Any help would be much appreciated. I apologise if any forum rules have not been followed.
1 Kommentar
Akzeptierte Antwort
Weitere Antworten (1)
Sara
am 27 Jan. 2015
0 Stimmen
Try replacing FileName(s) with FileName{s}
Kategorien
Mehr zu Convert Image Type finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!