embedded matlab function block

Hi fellows matlab
I want to generate a code using embedded function block I've written a function with some input arguments, each one will be taken from workspace from MATLAB.
I read that to specify an input argument from MATAB workspace, I should go through model explorer or tool > edit data ports, in the contents pane, set scope to parameter, and so, the input value will be take from workspace.
should I specify the type or class of each values of input in the same code written in the embedded editor from simulink block, or should be enough with set the values as I describe before to be used for the program written??
I'm explain well? thanks guys

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2012년 11월 14일

0 개 추천

You can set the parameter type to "Inherited" on the Ports and Data Manager (Tools > Edit Data/Ports) if you would like to block to inherit the type from the value in the workspace.

댓글 수: 4

well, basically my doubt is next. if my main function is the next, and my values inputs arguments are taken by workspace. how should I declare xy in the embedded editor?
function [optRoute,minDist] = travel_s_p(xy,dmat,popSize,numIter)
xy = ?
greetings
global xy
Emmanuel Luevano
Emmanuel Luevano 2012년 11월 16일
thanks for the tip, but, it does not is supported by embedded coder? do you have any other advise? greetings!!
Kaustubha Govind
Kaustubha Govind 2012년 11월 19일
If "xy" is an input, it should come from the input port of the block in the Simulink model. If "xy" is a parameter, it should be defined in the MATLAB workspace.

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

카테고리

도움말 센터File Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기

질문:

2012년 11월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by