Last active
February 29, 2016 18:53
-
-
Save saralilyb/735c9912380e23e396aa to your computer and use it in GitHub Desktop.
Replicates a baby version of MATLAB's meshgrid in CoffeeScript using the NumericJS library: http://www.numericjs.com.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
meshgrid = (value) -> | |
m = [] | |
value_length = value.length | |
i = 0 | |
while i < value_length | |
m.push(value) | |
i += 1 | |
[m, numeric.transpose(m)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can remove the transpose command to get simpler behavior.