MATLAB Answers

Vector with numerator 1 unit less than denominator

4 views (last 30 days)
Deana Sadrieva
Deana Sadrieva on 2 Feb 2020
How can I make a vector with these values?
0, 1/2, 2/3, 3/4, 4/5, 5/6, 6/7, 7/8, 8/9, 9/10

  1 Comment

Sign in to comment.

Answers (1)

Raj
Raj on 3 Feb 2020
format rat
A=input('Enter number of elements:') % Enter 10 for this example
for ii=1:A
Out_Vector(ii)= (ii-1)/ii;
end
Out_Vector

  3 Comments

Walter Roberson
Walter Roberson on 3 Feb 2020
We discourage people from providing complete solutions for homework assignments.
Raj
Raj on 3 Feb 2020
Sorry. Didn't realize it was a homework problem.

Sign in to comment.

Sign in to answer this question.

Products