how do i run a mex code in a matlab function block

조회 수: 1 (최근 30일)
tochukwu victor
tochukwu victor 2015년 9월 25일
댓글: Walter Roberson 2015년 9월 25일
I have gotten a mex code but I don't know how to run this code on a MATLAB function block. The function block is part of a smulink model.

채택된 답변

Walter Roberson
Walter Roberson 2015년 9월 25일
If you have a compiled mex such as a .mex64 file, then those files are treated like built-in commands whose name is the name of the mex file. You can refer to them by name in your MATLAB Function Block, without needing anything special, just as if they were a Mathworks-provided routine.
  댓글 수: 2
tochukwu victor
tochukwu victor 2015년 9월 25일
Thanks but please how can I refer to it?
Walter Roberson
Walter Roberson 2015년 9월 25일
By name. For example in your MATLAB function block
function result = func(u)
xyz = zeros(1,20);
xyz = NameOfMexFile(u);
result = sqrt(xyz);

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by