Runnin a Matlab function in a new Matlab instance by using the system command

10 ビュー (過去 30 日間)
Lorenzo Paolo Corgnati
Lorenzo Paolo Corgnati 2020 年 2 月 24 日
回答済み: Jonas 2022 年 8 月 11 日
Within a running Matlab instance I need to run a function with arguments in a new Matlab instance. This is the code of the function (for simplicity this is a dummy test function replicating my needs):
function res = networkID(inp)
res = inp;
save('netID.mat','inp');
disp('processing done');
return
This is the code of the call:
x = 'HFR_WHub_TEST';
logFilename = 'Test.log';
system(['/usr/local/MATLAB/R2018a/bin/matlab -nosplash -nodesktop -r ''networkID(''' x '''); quit'' -logfile ' logFilename ' &'])
The log file reports this:
< M A T L A B (R) >
Copyright 1984-2018 The MathWorks, Inc.
R2018a (9.4.0.813654) 64-bit (glnxa64)
February 23, 2018
[Warning: Function count has the same name as a MATLAB builtin. We suggest you
rename the function to avoid a potential name conflict.]
To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.
{Undefined function or variable 'HFR_WHub_TEST'.
}
Can anybody tell me if it is possibile to let it work and how?
Thanks.

回答 (1 件)

Jonas
Jonas 2022 年 8 月 11 日
Hello Lorenzo, I am facing the same challenge. I want to call a function but it should run in a new matlab instance. Have you solved the problem? Greetings!

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by