saving values in an array from an iteration

조회 수: 1 (최근 30일)
basma alshaibah
basma alshaibah 2019년 4월 11일
편집: Matt J 2019년 4월 11일
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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by