run Mex files on a linux server

13 次查看(过去 30 天)
Dear all,
I am new to the Mex-file world of Matlab. I have recently learnt to run a Mex file on my own PC. However, I eventually want to put the program on a linux server. I wonder if there is any handy way I can do this. Thanks, and I look forward to hearing from you!
Best, Long

采纳的回答

Walter Roberson
Walter Roberson 2022-3-23
You will need to recompile the mex function code under Linux; the .mexw64 generated on your Windows system will not work under Linux.
It is probably better to recompile it on the server itself, so that you get consistent tool-chains.
  6 个评论
Walter Roberson
Walter Roberson 2022-3-23
I am not very familiar with lagmatrix(). It looks to me as if for the numeric case, it could be written in terms of arrayfun. Find the minimum lag, if it is less than zero then each copy of the matrix must be pre-padded with min(lag,0)-min(lag) NaN rows. Find the maximum lag, if it is positive then each copy of the matrix must be post-padded with an appropriate number of NaN. Once the vectors of prepad and postpad have been calculated then you can
cols = size(TheArray,2);
Lagged = cell2mat(arrayfun(@(Pre,Post) [NaN(Pre, cols); TheArray; Nan(Post, cols)], PrePad, PostPad, 'uniform', 0))
Long Hong
Long Hong 2022-3-23
Thanks so much, Walter! These are super helpful!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Coder 的更多信息

产品


版本

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by