I used these loops to get the volume of particles from multiple fotos. Each iteration for 'f' is a separate foto. The table 'results' gets the properties for each foto and 'results_total' combines the results. The table 'results' also has different number of rows with each iteration.
I wanted to do the same with the second loop, where 'j' gives the number of particles identified in each picture and with Vol(j) I get the volume of each particle. As I did above I wanted to save the results for all fotos in 'Vol_total' but I get the values from the first foto, so f=1 added 2 times. So for example in the first foto there are 141 particles and in the second 111, Vol_total returns a double array 282x1 instead of 252x1.
How can I change the code to get the right results? Thank you!
results = regionprops('table',lm2, 'Area','Perimeter','MinFeretProperties','MaxFeretProperties');
results_total = vertcat(results,results_total);
Vol_total = [Vol_total; Vol'];