Question Quickly assign linear step values to an array?

spdracer22

Member
Joined
Oct 18, 2007
Messages
7
Programming Experience
3-5
I want to assign a double() array a set of values from 0 to 5 in increments of 0.1.

In Matlab, I can just say:

VB.NET:
myVar = 0:0.1:5

Is there an equivalent in VB.net, or do I need to use a loop?
 
Basically no, but .Net 3.5 has some new functionality that will allow to generate such range combining a few calls like this:
VB.NET:
Dim range = Array.ConvertAll(Enumerable.Range(0, 51).ToArray, Function(x) x / 10)
 
Back
Top