Specifying the input names in an automatically generated matlab function

조회 수: 4 (최근 30일)
Cosimo Della Santina
Cosimo Della Santina 2017년 11월 23일
편집: Pramil 2024년 11월 26일
Hi, I am generating a matlab function through the following command
matlabFunction(P_grad,'File',[ag_name,'Pgrad_fun'],'Vars',{x_ref, x},'Outputs',{'dP'});
The resulting function header is
function dP = Pgrad_fun(in1,in2)
while I would like to have
function dP = Pgrad_fun(x_ref,x)
Do you have any suggestions?
Note: the matlab function correctly works. I simply don't like that I don't have an informative declaration.

답변 (1개)

Pramil
Pramil 2024년 11월 26일
편집: Pramil 2024년 11월 26일
Hi Cosimo,
In order to get the results that you want, try the following command which works in both MATLAB R2017b and MATLAB R2024b:
matlabFunction(P_grad,'File','Pgrad_fun','Vars',{x_ref, x},'Outputs',{'dP'});
Hope it helps.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by