linespace function in matlab

i have question related to linespace ,as definition of linespace from matlab tutorials,it is function which generates linearly spaced points,but what does means linearly spaced points?for example following code linspace(5,10,4) Generates 4 linearly spaced points between 5 and 10.so it means that between these posint there exist linear relationship?like

y=a*x+b? 

because if it is equally spaced points ,then it would be

5 6.25 7.5 8.75 

so i want to master in this function and clarify everything related this function for using next time.thanks a lot of

2

1 Answer

To clarify - the function is called linspace not linespace, and you are correct. As per the documentation, "y = linspace(a,b,n) generates a row vector y of n points linearly spaced between and including a and b", so the points do follow a y = mx + c relationship. a is the start y value, b is the end y value, and n is simply the number of points to sample, so it does not affect the linear relationship.

5

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like