Vector with numerator 1 unit less than denominator

Risposte (1)

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 Commenti

We discourage people from providing complete solutions for homework assignments.
Sorry. Didn't realize it was a homework problem.
This is MATLAB, so there is no need to use a loop. This approach is simpler and more efficient:

Accedi per commentare.

Categorie

Scopri di più su Mathematics in Centro assistenza e File Exchange

Prodotti

Richiesto:

il 2 Feb 2020

Commentato:

il 3 Feb 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by