Skip to content

Instantly share code, notes, and snippets.

@saralilyb
Last active February 29, 2016 18:53
Show Gist options
  • Save saralilyb/735c9912380e23e396aa to your computer and use it in GitHub Desktop.
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.
meshgrid = (value) ->
m = []
value_length = value.length
i = 0
while i < value_length
m.push(value)
i += 1
[m, numeric.transpose(m)]
@saralilyb
Copy link
Author

You can remove the transpose command to get simpler behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment