Borrar filtros
Borrar filtros

how to use for loop and while loop in this equation?

1 visualización (últimos 30 días)
Engineer Batoor khan mummand
Engineer Batoor khan mummand el 6 de Mzo. de 2021
Editada: Engineer Batoor khan mummand el 6 de Mzo. de 2021
hi to all,
i hope you all will be fine and doing well,
(1) i have four initial values x=0, x=0.3, x=0.07 and x=0.001 i want find the values of p such that when x reaches to 1 or greather than 1.
(2) when x reaches to 1 it sholud strat again and take second intial value which is given above the programme and it should continoue till last intial value.
thanks
where x is initail value
n=8;
v=4
t=0.5
for i=1:n-1
x=0
while x<=1
itn=itn+1
p(1:n,i)=2*x+4*v
x=x+t
end
end

Respuestas (0)

Categorías

Más información sobre Programming en Help Center y File Exchange.

Productos


Versión

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by