MATLAB Answers

How do i display all the values of this for loop?

8 views (last 30 days)
L = input('Enter the Length ');
ne= input('Enter Number of Elements ');
a=L/ne;
for b = 1:ne
c = 0 + (b)*a;
end

  0 Comments

Sign in to comment.

Accepted Answer

David Hill
David Hill on 13 Jan 2020
for b = 1:ne
c = 0 + (b)*a%remove ;
end
or
c=zeros(1,ne);
for b = 1:ne
c(b) = 0 + (b)*a%remove ;
end
display(c);%all values stored and array

More Answers (0)

Sign in to answer this question.

Tags

Products


Release

R2019b

Translated by