Matrix input/output to a Matlab function block in simulink
Ältere Kommentare anzeigen
I need help creating a MATLAB function block in simulink. How do i make a MATLAB function block take in a large matrix from the workspace as its input (say a 1000 by 15 matrix), and also give its output as a matrix?
2 Kommentare
Mathieu NOE
am 23 Okt. 2020
hi
simply creat that input matrix in the workspace (do it from a maytlab script if needed)
if that matrix is "A" then in simulink use the constant bloc or DSP constant block with A as argument (edit box)
now what you do in the simulink file must be coherent with a matrix input ... not every bloc / function accept m by n size inputs.
Femi Bolarinwa
am 26 Okt. 2020
Akzeptierte Antwort
Weitere Antworten (1)
Fangjun Jiang
am 23 Okt. 2020
0 Stimmen
Use a Constant block, specify the value as the variable in the base workspace, then you will be able to use it, no matter what is the size of the matrix. When you construct the code for the MATLAB Function block, click the "Edit Data" button and specify the size of input and output variable.
1 Kommentar
Femi Bolarinwa
am 26 Okt. 2020
Kategorien
Mehr zu Array and Matrix Mathematics finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!