MATLAB MATLAB: 100 element vector between A and B

AI Thread Summary
A user inquired about efficiently defining a vector with 100 elements that spans between two different values. They mentioned using division to determine a step size but were seeking a quicker method. Another participant recommended using the 'linspace' function, which directly generates a specified number of evenly spaced values between the two endpoints, effectively addressing the user's needs.
TheFerruccio
Messages
216
Reaction score
0
Is there a quick way to define a vector with 100 elements going between two different values?

I know of just using division and using that as a step size, but it would be nice if there was something quicker.
 
Physics news on Phys.org
Code:
help linspace
 
Thank you very much for the help! That is exactly what I am looking for.
 

Similar threads

Replies
32
Views
4K
Replies
2
Views
1K
Replies
6
Views
2K
Replies
1
Views
2K
Replies
1
Views
2K
Back
Top