What's going on when setting these parameters?
Mostrar comentarios más antiguos
So my question is quite simple.
I'm plotting, for example:
x=[0:0.1:4]
plot(x, sqrt(x), 'b.-')
title('Square root')
grid on
From trial & error I see that the numbers 0, 4 are my x-axis parameters, i.e. I'm printing the function for XE[0,5].
What exactly is the 0.1 for? What's that number doing? What's its purpose?
Thanks!
Respuestas (2)
Les Beckham
el 28 de Feb. de 2022
0 votos
That sets the increment for the x vector.
Read the documentation for the colon operator: colon
Image Analyst
el 28 de Feb. de 2022
0 votos
It's the step distance from one x value to the next. Look at your x values:
x = 0 0.1000 0.2000 0.3000 0.4000
See, they're 0.1 apart.
Categorías
Más información sobre Get Started with MATLAB en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
