How to add "for loop"
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Tousif Ahmed
el 18 de Abr. de 2017
Comentada: Rik
el 18 de Abr. de 2017
in workspace i have "dinfo" having 11x1 struct as shown in figure, i want to access "name" as it has images in it, after reading that, need to convert it into double format for each image and storing that in a folder as "dataset.mat", can anyone please help me with the code please. Thank You
3 comentarios
Rik
el 18 de Abr. de 2017
If you don't understand an answer, ask for clarification. By opening multiple questions that are essentially the same, you don't really generate goodwill. I think you should really start a tutorial to get to know the Matlab basics. I'm sure there are many of them in whatever language you prefer.
Respuesta aceptada
Rik
el 18 de Abr. de 2017
You're in luck. I usually ignore questions that don't show that the person asking has followed the advice from the question guide.
Images=cell(1,2);%pre-allocate a column-vector in the cell format
for n=1:length(dinfo)
position=str2double(dinfo(n).name(1:(end-4)));%convert the filename to a number
Images{position}=im2double(imread(dinfo(n).name));%read the image, convert to double and save in the cell
end
4 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Get Started with MATLAB en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!