MATLAB Answers

0

Time table code using while loops

Asked by Jose Grimaldo on 21 Oct 2019
Latest activity Answered by David Hill on 22 Oct 2019
Screenshot (156).png

  0 Comments

Sign in to comment.

1 Answer

Answer by David Hill on 22 Oct 2019

Not sure why you have to use a while loop.
function T = timesTable(n)
T=1:n;
count=2;
while count<=n
T(count,:)=count*T(1,:);
count=count+1;
end

  0 Comments

Sign in to comment.