Borrar filtros
Borrar filtros

For loop invalid syntax problem, very frustrating.

5 visualizaciones (últimos 30 días)
skunkezpzeke
skunkezpzeke el 14 de Abr. de 2015
Editada: James Tursa el 15 de Abr. de 2015
I keep getting the error: "invalid syntax at 't' possibly a ),},or] is missing" I seriously have tried everything I can think of to fix this, but nothing works. help please.
for t = 1:250
Htheo(t)=4*(1-exp(-0.032t))
end

Respuestas (2)

Roger Stafford
Roger Stafford el 14 de Abr. de 2015
Put an asterisk between the 0.032 and the 't':
Htheo(t)=4*(1-exp(-0.032*t))

Star Strider
Star Strider el 14 de Abr. de 2015
You’re missing a multiplication operator ‘*’. MATLAB doesn’t assume multiplication if no operator is stated.
This works:
for t = 1:250;
Htheo(t)=4*(1-exp(-0.032*t));
end

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by