Hi,
I am working on a task. I have to use the "for-loop" command. I already used it, now I would like to create a table with the results. I would like to see in the table the option of the menu that was selected and the number of seeds that are allowed given the area that the person inserted. But I don't know how to make that table with the well established results. I don't know a command for it.
clear
clc
n=input('Enter the number of time you want this program to run.n= ');
Area=input('Enter the area of the land in m2. Area= ');
D = sqrt(Area*10000);
for i=1:n
v= menu('Select the aromatic species with which you will work:', 'Basil' ,'Cilantro', 'Dill', 'Tarragon', 'Spearmint', 'Oregano', 'Parsley', 'Thyme');
if v==1
distrows =15;
distplant = 30;
elseif v==2
distrows= 15;
distplant =20;
elseif v==3
distrows =15;
distplant = 20;
elseif v==4
distrows =15;
distplant = 20;
elseif v==5
distrows =25;
distplant = 50;
elseif v==6
distrows =15;
distplant=20;
elseif v==7
distrows =15;
distplant = 20;
elseif v==8
distrows =15;
distplant = 20;
end
rows=D/distrows;
seedrow=rows/distplant;
seeds=round(rows *seedrow)
end
1 Comment
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/497660-creating-a-table-for-the-for-loop-command-results#comment_780088
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/497660-creating-a-table-for-the-for-loop-command-results#comment_780088
Sign in to comment.