Fractional steps in for loops
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello! This is the first time i am running fractional steps in for loop and i am not sure wheter this is just comepletely wrong or if this is the way it works.
yHH = 1:0.1:3;
for yH = 1:length(yHH)
Function(yH)
end
i get the following output
1
4
3
5
1
3
4
10
So what I was expecting was 1.1,1.2,1.3, etc....but I got the above numbers. Are those index numbers like for example below
1 = 1
2 = 1.1 % index 2 equates to the the second step within then range?
3 = 1.2
4 = 1.3
......
10 = 1.9
Appreciate any help! Thanks!
0 comentarios
Respuesta aceptada
Voss
el 29 de Dic. de 2021
yHH = 1:0.1:3;
for yH = 1:length(yHH)
display(yH);
end
compare to:
yHH = 1:0.1:3;
for yH = 1:length(yHH)
display(yHH(yH));
end
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!