MATLAB: .mex file for a function

errormex

Hello,
I am running into some trouble for a function given by:
function y = fyrandperm(x)
% FYRANDPERM - Shuffles elements in random order.
%

% Y = FYRANDPERM(X)
% If X is a real matrix or vector then Y contains the elements
% of X in random order. If X is a real scalar then Y contains
% 1:X in random order.
%
n = prod(size(x));
if n == 1
n = x;
x = 1:n;
end
y = fyrandperm_mex(x,rand(1,n));
I did not write this function myself and I am trying to use it but the problem is that it calls to
fyrandperm_mex
which is a .mexw64 file. I am not precisely sure what to do with this as I cant really open it on my 2015b matlab for mac. Could someone please offer some advice ? The error I am running into states: Error in fyrandperm (line 20) y = fyrandperm_mex(x,rand(1,n));
Any help would be appreciated.
Thank you

Best Answer

You need to get a copy of fyrandperm_mex compiled for OS-X . If the source code is available, you can use the "mex" command to compile it (after you have installed and configured a compiler for your OS-X version)
mex -v fyrandperm_mex
Related Question