Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This looks long but I\'m pretty sure it\'s a fairly simple issue. I am working o

ID: 3693386 • Letter: T

Question

This looks long but I'm pretty sure it's a fairly simple issue.

I am working on a Matlab project and need some help building a table. I have very little Matlab experience. I need this loop to write the values of each variable into a table on every tenth iteration of the loop (this is the purpose of printcounter). Here is how I have the loop right now (sample of part of the code):

while mwater>0

Loop works with all the variable here.

At the end, I need a table to be built.
if printcounter==9
T=table(t,Pair,Temp,Fthrust,Fgravity,Fdrag,Fnet,mwater,mair,mtotal,arocket,vrocket,x);

end
  
end

The way I have this right now the table is totally rewritten each time. I need it to add another row onto the table with the new values from each iteration. Help is greatly appreciated!

Explanation / Answer

mwater=1 //initialize here
while mwater>0
Loop works with all the variable here.
At the end, I need a table to be built.
if printcounter==9
T=table(t,Pair,Temp,Fthrust,Fgravity,Fdrag,Fnet,mwater,mair,mtotal,arocket,vrocket,x);
end
mwater ++ //increment here
  
end

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote