sqr = @(x,y) x.^2+y.^2; % Anonymous function, f = @(arglist)expression
arrayfun(sqr, [3 4],[4 4]) or arrayfun(@(x) x^2, [2 3 4])
Last active
January 3, 2017 07:08
-
-
Save tobbe11/af39e09ff7f13b1a0563f233250f74fb to your computer and use it in GitHub Desktop.
Matlab
This file contains 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
#include "mex.h" | |
void | |
mexFunction (int nlhs, mxArray *plhs[], | |
int nrhs, const mxArray *prhs[]) | |
{ | |
mexPrintf ("Hello, World!\n"); | |
mexPrintf ("I have %d inputs and %d outputs\n", nrhs, nlhs); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment