Contact an Expert

Thread: Load and save mat file in SystemVue


Permlink Replies: 1 - Pages: 1 - Last Post: Mar 16, 2011 9:36 AM Last Post By: dleiss Threads: [ Previous | Next ]
widapol

Posts: 1
Registered: 03/06/11
Load and save mat file in SystemVue
Posted: Mar 6, 2011 11:54 PM
Click to report abuse...   Click to reply to this thread Reply
Hi all,
I want to implement a co-simulation of Matlab and SystemVue, specially load and save a MAT file (data file of matlab) in SystemVue. How can I do it?
dleiss

Posts: 2
Registered: 01/22/08
Re: Load and save mat file in SystemVue
Posted: Mar 16, 2011 9:36 AM   in response to: widapol in response to: widapol
Click to report abuse...   Click to reply to this thread Reply
The simplest way is to utilize the #matlabregion in the SystemVue MathLang component:

setmatlabvariables input;
#matlabregion
output = fft(input, 1024);
r = real(output);
i = imag(output);
a = output;
% Two added lines to do file I/O
save ('C:\MyFile','a');
b = load('C:\MyFile');
#endregion
getmatlabvariables r i;
output = r+j*i;

This is a modified version of MATLAB Integration Demo.wsv workspace that is a shipped example provided with SystemVue under ..\examples\Model Building\Math Language Modeling

Point your RSS reader here for a feed of the latest messages in all forums