"Not enough input arguments" error using add_line()

조회 수: 1 (최근 30일)
Lucas S
Lucas S 2019년 6월 28일
댓글: Lucas S 2019년 6월 28일
Hello !
I'm trying to use add_line() function and to organize link with the 'autorouting' parameter. Here is my code :
add_line(sprintf('%s',diagrammeName), [pos_array_out{pos_out};pos_array_in{pos_in}], 'autorouting','on');
where pos_array_out is a cell of Output position and pos_array_in is a cell of Input position.
And pos_in and pos_out are index of cell.
But it returns me an error :
Not enough input arguments
And i don't understnd why

답변 (1개)

Stephen23
Stephen23 2019년 6월 28일
편집: Stephen23 2019년 6월 28일
"...i don't understnd why"
Read the error message!
According to the add_line documentation you can supply these input arguments:
add_line(sys,out,in,'autorouting',autoOption)
but in your code you have concatenated out and in into one array. Try this:
add_line(sprintf('%s',diagrammeName),...
[pos_array_out{pos_out}],... OUT
[pos_array_in{pos_in}],... IN
'autorouting','on');
  댓글 수: 2
Lucas S
Lucas S 2019년 6월 28일
The problem is that pos_array_out{pos_out} is a Position from get_param('System', 'PortConnectivity') (for example 150 75) and so it returns me Invalid Simulink port handle when i do like you say
Lucas S
Lucas S 2019년 6월 28일
I'm using this way of {add_line()function : h = add_line(sys,points)`

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

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by