saving values in an array from an iteration

3 views (last 30 days)
basma alshaibah
basma alshaibah on 11 Apr 2019
Edited: Matt J on 11 Apr 2019
can someone help me i have this code it takes a number of images (200) each 20 images are from 1 folder so that 10 folders.
im trying to take the mean and standard deviation of each image and store them in an array, i already have an array 'F' that takes the mean and standard deviation as attributes and i created another area with 2 rows and 200 columns to fit the mean and standard deviation of each image in each column. how can i do that ?
this is my code :
for i = 1:10 %read folder 10 times
fname = strcat('C:\Users\Basma\Desktop\projectpartialdb\' , num2str(i))
dir(fname)
for j= 1:20 % read all 20 images in each folder
imname = strcat(fname , '\' , num2str(j), '.png')
im=imread(imname);
im=im2bw(im);
F=FeatureStatistical(im) % an array that takes the mean and standard deviation as attributes
end
end
this is what i want to do i want to iterate on all of the 200 images and take their mean and standard deviation and store them in array A. where each column represent an image.
for i = 1:200
A = [1:200;1:200];
F=FeatureStatistical(im)
%it says here that i can't use i as an array element
A(1,i) = F(m) ;
A(2,i) = F(s) ;
end

Answers (0)

Community Treasure Hunt

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

Start Hunting!