MATLAB: Hi, how to adding value to array in existing array

adding arrayarray

I have aray containing headers and values from some feature extractions. I also have 275 images. When I run my code, I want the value from the overall extraction of my image to be stored in the same array without deleting the extraction value of the previous image feature. below I created a code that only stores feature extraction values from one image, when I run the code for the next image, the previous value disappears. Please help me to complete my code. Thanks
header = {'area','perimeter','roundness','solidity','slimness','rectangu','NF','RPD'};
classinfo = {Area Perimeter Round Slimness Rect soli NF RPD RPLW};
Fitur = [header; classinfo];

Best Answer

Solution is to save the array in .mat file, therefore, for next time to run the script, it will load the mat file, and add new value to the variable/table in the .mat file.
%save in array matlab
try
load Fitur.mat
catch me
end
if exist('Fitur','var')~=0
height = size(Fitur,1);
ID = height+1;
else
Fitur = [];
ID = 1;
end
classinfo = [ID area perimeter roundness solidity slimness rectangu NF RPD...
RPLW M1 M2 M3 M4 M5 M6 M7 mu deviasi energi entropi smoothness...
contrast homogenitas energi korelation];
Fitur = [Fitur; classinfo];
Fiturtable=array2table(Fitur);
header = {'ID' 'area','perimeter','roundness','solidity','slimness','rectangu','NF','RPD'...
'RPLW','M1','M2','M3','M4','M5','M6','M7','mu','deviasi','energi','entropi','smoothness'...
'contrast','homogenitas','energi2','korelation'};
Fiturtable.Properties.VariableNames = header;
save('Fitur.mat','Fitur','Fiturtable')