Borrar filtros
Borrar filtros

Hey People :) Im trying to using a for loop to create and print an array of a Geometric Serise that stores the first 10 terms of the sequence that halves each time i.e. {1/2, 1/4, 1/8, 1/16, ... 1/1024 }

1 visualización (últimos 30 días)
My method obviously is to use a for loop but my problem is printing the array.
Could somebody please write a script to help me
Thanks

Respuesta aceptada

Stalin Samuel
Stalin Samuel el 8 de Dic. de 2015
a1 = ones(10,1);
a(1) =2;
for i = 2:10
a(i) = a(i-1)*2;
end
format rat
a1./a

Más respuestas (1)

Walter Roberson
Walter Roberson el 8 de Dic. de 2015
To print the array stored in GS:
disp(GS)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by