input and outpt in simulink

hi how to give input from textfile to simulink(power system) voltage source and how to store output (from voltage mesurement)vlaue dirtecly to DB or File. thanx

Answers (1)

Andreas Goser
Andreas Goser on 8 Mar 2012
I assume you mean signals, not parameters.
Input: Either From File or From Workspace block. This depends on the structure of the text file. I suggest that you try to import the file into MATLAB first and then use "from workspace"
Output: Pretty similar: To Workspace or To File are two options
In general, you may wnat to investigate model callbacks, e.g. such a call back that executes after the model is completed. Here you e.g. could write MATLAB code that sends results from the workspace to a database.

3 Comments

Here is some info on model callbacks, which are new to me, http://www.mathworks.com/help/toolbox/simulink/ug/f4-122589.html . Are there any advantages (in execution speed, readability, etc) of using model callback instead of simply writing a Matlab script to run the simulation, take its output, and save it to a file?
One advantage I can think of is that it all stays in a single file.
Thanks!

Sign in to comment.

Categories

Find more on Simulink in Help Center and File Exchange

Asked:

on 8 Mar 2012

Community Treasure Hunt

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

Start Hunting!