For SIMULINK level-1 S function how to address two inputs which are matrices

if the inputs to the S function are two which are matrices
in the first place how to declare them in the function syntax *function [sys,x0,str,ts,simStateCompliance] =multiply(t,x,u,flag,)***
and how to adress the elements of the matrices say if A and B are the input matrices
A(1,1) and B(2,1) something like that..
Please help in this regard Thanks in advance

 Accepted Answer

Since Level-1 MATLAB S-functions only have one input, you'll need to concatenate A and B to supply them as the input. Your indexing will depend on how you concatenate them before supplying them to the S-function.
Also, may I recommend that you try and switch to using Level-2 MATLAB S-functions? Level-1 S-functions have been deprecated for a long time, and have very limited features. Please see Convert Level-1 MATLAB S-Functions to Level-2.

More Answers (0)

Categories

Find more on Simulink in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!