About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
  • License: Freeware
  • Last update: 6 years ago
  • Total downloads: 117
  • Price: Free |
  • Operating system: Linux, Mac OS X, Win All, BSD, Solaris
  • Publisher: Mike Anthony (5 other programs)
See full specifications

scripts default iconCreate Bus Data for Models with Root-Level Bus Inputs (Scripts) Publisher's description

A common task in Simulink is to test a certain component of a larger model.

A common task in Simulink is to test a certain component of a larger model. With large-scale modeling, such componentization is often accomplished through the use of model reference. These large models also often use bus signals to organize large amounts of signals in the model. The situation at hand is the desire to unit test one of these components in an open-loop sense, driving that component with data from another simulation or from real world (non-simulated) data. Often this data is simply a matrix of data, columns of variables, rows of data. Making this data work with root-level bus inputs in a Simulink model is sometimes a challenge.

The root cause of this challenge has to do with an understanding of Bus Objects. Assume there is a root-level inport which is associated with a bus object "INPUT_BUS." In Simulink, and in code generated by RTW-EC, a bus object is a data type, analagous to a struct definition in C. So the issue is that the root level inport is expecting data of type INPUT_BUS. Unfortunately, the data you’re getting extrenally and importing into Matlab is often a matrix of doubles of size mxn. As such, this data needs to be converted from the double precision matrix into type INPUT_BUS.

One way to accomplish this is to manipulate the data in Matlab to create a Simulink.TsArray object comprised of Simulink.TimeSeries objects that corresponds with the bus object INPUT_BUS. This is probably the cleanest way, as this is how Simulink understands data in buses defined by bus objects. The best example of this is if you log a bus signal using signal logging, the data in the workspace would be a Simulink.TsArray. This function takes the double precision matrix data and packs it into a Simulink.TsArray based on the definition of the type INPUT_BUS (including sizes and data types). The resulting TsArray is then suitable to drive a simulation of that component without the need for altering the inport in the model or creating a test harness.

This script is dependent on the functions CreateTsArray.m, CreateTsArray.p, CreateTimeSeries.m, and CreateTimeSeries.p available in the followin Matlab Central Post:

System Requirements:

MATLAB 7.7 (R2008b)
Program Release Status: New Release
Program Install Support: Install and Uninstall

Create Bus Data for Models with Root-Level Bus Inputs (Scripts) Tags:

Click on a tag to find related softwares

Is Create Bus Data for Models with Root-Level Bus Inputs (Scripts) your software?

Manage your software

Most Popular

scripts default icon ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation
scripts default icon Simulink Communication Labs 1.1
Simulink Communication Labs allows you to learn communication systems in greater depth.
scripts default icon M-QAM modulation and demodulation 1.1
M-QAM modulation and demodulation is the QAM modulation and demodulation tech.
scripts default icon LZW Compression/Decompression 1.1
LZW Compression/Decompression - Updated LZW compressor and decompressor with reasonable performance
scripts default icon InSPIRE utility to plot a 2D displacement field (Scripts) 1.0
This program plots the deformation field (displace vectors) contained in vector.txt.