QuantEcon.cheatsheet icon indicating copy to clipboard operation
QuantEcon.cheatsheet copied to clipboard

Creating Vectors by range in Julia should be change.

Open sppmg opened this issue 6 years ago • 1 comments

Hi I am new in Julia.

The Integers from j to n with step size k in Creating Vectors write:

A = j:k:n

It just is a range object in Julia, but in Matlab, it can create a array. So I think maybe change to

A = collect(j:k:n)

or maybe add a row for range and create array.

Thanks your beautiful cheatsheet.

sppmg avatar May 16 '19 01:05 sppmg

I can see how this is confusing. I'd rather not teach people to collect() things by default (because the whole point is that it's "lazy," in that it only gives you the actual array if you need it.)

The best approach is probably to explain briefly in a comment. Will do that. Thanks for your helpful feedback, and I'm glad you found the cheatsheet useful.

arnavs avatar May 16 '19 17:05 arnavs