stand alone exe and passing arguments

조회 수: 1 (최근 30일)
David Pesetsky
David Pesetsky 2018년 6월 19일
댓글: David Pesetsky 2018년 6월 20일
Hi. Here's an example of what I compiled, how i invoke it, and the error. It's on DOS.
function success = allFat (sourcecode,dir,fat_dir,results_type,location,method_type,bin_size,lifetime,n_processors_input)
results_type = str2double(results_type);
bin_size = str2double(bin_size);
lifetime = str2double(lifetime);
n_processors_input = str2double(n_processors_input);
do stuff with these args...
end
Invoked like:
>fatigue_GE127_45cores_bin_size2_forEXE.exe J:\Calc\path J:\Calc\anotherPath J:\Calc\path\morePath 3 b GL 2 20 45
The error:
Undefined function or variable 'fatigue_GE127_45cores_bin_size2_forEXE'.
MATLAB:UndefinedFunction
Error:Undefined function 'fatigue_GE127_45cores_bin_size2_forEXE' for input arguments of type 'char'.

답변 (2개)

Walter Roberson
Walter Roberson 2018년 6월 19일
You might need to name it allFat.exe in order to invoke allFat as your entry point.

David Pesetsky
David Pesetsky 2018년 6월 19일
Instead, I named the function fatigue_GE127_45cores_bin_size2_forEXE, AND used the project compiler to compile it, where I saw it pull in dependencies, and now it works. Does it mean that mcc -m doesn't grab the dependencies???
  댓글 수: 4
Walter Roberson
Walter Roberson 2018년 6월 19일
data point:
I just tested on Mac, compiling with R2018a. The name of the executable did not affect which function was called first.
David Pesetsky
David Pesetsky 2018년 6월 20일
Yes and, data point, I have same names and compiled again with mcc -m and had the same error again. v2017a. Compiling using a prj file and letting it pull in dependencies works, for me.

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

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by