MATLAB: Linking of mfile with simulink model… mfilesimulink How to link the block of matlab function for multiple input and output from simulink model??? It is running for single input variable only. Best Answer Are you talking about the "MATLAB Function" block in the new release? Like the one in this link? http://www.mathworks.com/help/toolbox/simulink/slref/matlabfunction.htmlIf you define your function to have multiple input arguments and multiple output arguments, those input arguments and output arguments will show up as inports and outports on the block. Related SolutionsMATLAB: Linking simulink from m-file To call MATLAB code from a Simulink model, use one of the three MATLAB Function Blocks available. To run Simulink models from MATLAB, use the sim command. Also see Command Line Functionality for Simulink. MATLAB: Linking simulink from m-file This is a matter of the return variables of the SIM command. This examples code is from the documentation:Specify parameter name-value pairs within the sim command:simOut = sim('vdp','SimulationMode','rapid','AbsTol','1e-5',... 'SaveState','on','StateSaveName','xoutNew',... 'SaveOutput','on','OutputSaveName','youtNew');Important is, that you need - like in this example - an "out" Block at the end of the relevant signal(s). Related Question
Best Answer