exporting strings out of structure into a vector
Afficher commentaires plus anciens
Hello MatlabCentral-community,
I have a structure(1*k). For k images there is one time data. Now, I want to generate a vector (for each image one time data). But unfortunately, I'm struggling with this task.
I tried it by:
[filename, pathname] = uigetfile('C:\Users\Pictures\Cam\*.jpg', ...
'Select Pictures for processing',...
'Multiselect','on');
nop = length(filename); % number of pictures
for k = 1:nop
n = num2str(k);
info_all = imfinfo(fullfile(pathname, filename{k}));
end
Img_info(k) = info_all;
% until here it works (getting one single string)
timeinfo_single = Img_info.FileModDate
timevector(k) = Img_info(k).FileModDate
I would be very happy, if somebody could put me on the right track,
greetings,
Gemma
Réponse acceptée
Plus de réponses (2)
Nobel Mondal
le 30 Avr 2015
1 vote
Your Img_info variable is storing only the information of the last (nop-th) image, since it is outside the for loop.
Gemma
le 2 Mai 2015
0 votes
Catégories
En savoir plus sur Data Type Conversion dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!