What's going on when setting these parameters?
이전 댓글 표시
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!
답변 (2개)
Les Beckham
2022년 2월 28일
0 개 추천
That sets the increment for the x vector.
Read the documentation for the colon operator: colon
Image Analyst
2022년 2월 28일
0 개 추천
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.
카테고리
도움말 센터 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
