Download presentation
Presentation is loading. Please wait.
1
MATLAB Interface Programming
Young Joon Kim
2
Topics MATLAB Command in SPL Execute MATLAB in SPL
Execute Simulink model file Get Variable from MATLAB Get String from MATLAB Put string to MATLAB Put and Get Full Matrix Put and Get Workspace Data
3
MATLAB Command in SPL
4
MATLAB Command in SPL MATLAB Command under “Expression” tab
5
Execute MATLAB in SPL
6
Execute MATLAB in SPL Add “MATLAB” command as follows Double click
7
Execute MATLAB in SPL Add “matlab1.Execute()” command as follows
8
Execute MATLAB in SPL Type “print” command as follows
9
Execute MATLAB in SPL Save and execute script
10
Prepare Simulink
11
Prepare Simulink Draw below diagram with Simulink
12
Prepare Simulink Executed result
13
Prepare Simulink Save diagram as “satellite.mdl”
14
Execute Simulink model file
15
Execute Simulink model file
Type command [t,x,y] = sim(‘satellite.mdl’) Util.UserDataDir returns MSRDS’s UserData path
16
Execute Simulink model file
Execute script and print
17
Execute Simulink model file
Save and execute SPL script
18
Get Variable from MATLAB
19
Get Variable from MATLAB
Execute command
20
Get Variable from MATLAB
Use “matlab1.GetVariable()” command to get variable
21
Get Variable from MATLAB
Check the upper bound of returned array Dimension 1 and dimension 2
22
Get Variable from MATLAB
Print the value of variable
23
Get Variable from MATLAB
Save and execute script
24
Get String from MATLAB
25
Get String from MATLAB Define string value in the MATLAB
26
Get String from MATLAB Use “GetCharArray()” method to get string from MATLAB
27
Get String from MATLAB Save and execute script
28
Put String to MATLAB
29
Put string to MATLAB Use “PutCharArray()” command to send string to MATLAB
30
Put string to MATLAB Save and execute SPL script
31
Put and Get Full Matrix
32
Put and Get Full Matrix Define array and initialize
33
Put and Get Full Matrix Use “PutFullMatrix()” to send array data to MATLAB
34
Put and Get Full Matrix Send command to make matrix “b”
35
Put and Get Full Matrix Use “GetFullMatrix()” command to get matrix data from MATLAB
36
Put and Get Full Matrix Full script
37
Put and Get Full Matrix Save and execute SPL script
38
Put and Get Workspace Data
39
Put and Get Workspace Data
Use “PutWorkspaceData” to send data to MATLAB
40
Put and Get Workspace Data
Send command to define matrix “b” as follows
41
Put and Get Workspace Data
Use “GetWorkspaceData” command to get data
42
Put and Get Workspace Data
Save and execute SPL Script
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.