TECHNICAL UPDATES
 
Products Updates
 

LATEST Release 2007b is now available!
In September 2007, The MathWorks will ship Release 2007b. The latest updates include Simulink 7, new features in MATLAB, one new product released since R2007a and updates and bug fixes to 80 other products.

R2007b introduces a major new feature: C code generation from Embedded MATLAB functions directly at the MATLAB command line, using Real-Time Workshop®. In addition, Embedded MATLAB Function blocks in Simulink support algorithms in multiple M-files.

New capabilities for the Simulink product family include:

  • Simulation accelerators in Simulink provide compiled simulations and dual-core or dual-processor operations
  • Normal mode model reference and component-based modeling in Simulink
  • Bidirectional tracing and new target-specific code optimization architecture in Real-Time Workshop Embedded Coder and embedded target products
  • Code generation for Simscape and SimHydraulics
  • HDL code generation from Embedded MATLAB Function blocks and support for multirate designs in Simulink HDL Coder
  • Continuous time support in Stateflow, with zero crossings detection and differential equations authoring
  • Support for parallel computing in SystemTest using Distributed Computing Toolbox
  • Simulink Design Verifier, a new product for automatic test generation and property proving

New capabilities for the MATLAB product family include:

  • Support for numerical arrays >2x10^9 elements on 64-bit OS's in many MATLAB functions
  • Ability to read WMV, MPEG, and other video formats on Windows platforms in MATLAB
  • Video viewer and ROI tools for polygon, ellipse, and freehand selections in Image Processing Toolbox
  • Interleaving of parallel and serial code with parfor in Distributed Computing Toolbox
  • Interactive graphics for the Web, using AJAX to enable rotate, zoom, and pan in MATLAB Builder for Java
  • Support for Reuters Market Data System in Datafeed Toolbox

Major Update Products included in the release 2007b

  • Simulink 7
  • Aerospace Blockset 3
  • Aerospace Toolbox 2
  • Bioinformatics Toolbox 3
  • Communications Toolbox 4
  • Datafeed Toolbox 3
  • Excel Link 3
  • Image Acquisition Toolbox 3
  • Image Processing Toolbox 6
  • MATLAB Builder for Java 2
  • Real-Time Workshop 7
  • Real-Time Workshop Embedded Coder 5
  • Real-Time Windows Target 3
  • Simscape 2
  • Stateflow 7
  • Stateflow Coder 7
  • SystemTest 2

New Product Previously Released via the Web (R2007a+)

  • Simulink Design Verifier (at v1.1 in R2007b because of a minor update)

New features of Embedded MATLAB

R2007b introduces a major new feature: C code generation from Embedded MATLAB™ functions directly at the MATLAB command line, using Real-Time Workshop. In addition, Embedded MATLAB Function blocks in Simulink support algorithms in multiple M-files.

User can develop embedded algorithms with a subset of the MATLAB language, generate C or HDL code, and incorporate the algorithms into Simulink models and Model-Based Design workflows.

 
 
New Product
 

Simscape simplifies Modeling and Simulation of Multidomain Physical Systems
Building a model using first principle modeling method is not just time consuming but also an arduous task especially when dealing with complex physical system. Now, with Simscape you can easily model and simulate mechanical, hydraulic, and electrical components in a single modeling environment.

Simscape is consists of fundamental libraries of physical components, whereby users construct models by assembling these components rather than modeling the complex mathematical representation. Models built using Simscape are easier to comprehend as it resembles closely to a schematic diagram.


A model built using Simscape physical modeling blocks representing the DC motor

Key Features

  • Single modeling environment for modeling and simulating physical systems, such as mechanical, electrical, and hydraulic systems
  • Foundation library of physical modeling building blocks and fundamental mathematical elements
  • Ability to specify units of parameters and variables, with all unit conversions handled automatically
  • Connection blocks to bridge physical domains
  • Full simulation and limited editing capabilities for models built with SimMechanics, SimDriveline or SimHydraulics (no license required for these products)

For more information about Simscape, please visit the following URL:
http://www.mathworks.com/products/simscape/index.html

To learn more about Simscape through online recorded webinar, please visit the following URLs:
Modeling Hydraulic Systems

Through this webinar, attendees will see how Simscape and SimHydraulics can be used to model custom hydraulic components and hydraulic systems. This webinar will highlight how the tools can improve the development process, model a custom hydraulic component, and demonstrate best practices in modeling hydraulic systems.

To view the webinar, please click here.

 
 
Tips and Techniques
 

Do you find it difficult to write MATLAB codes that runs across multiple MATLAB releases?
In MATLAB Version 7.4, there is a new verLessThan function that compares the specified version number and toolbox name with the version of that same toolbox that is currently running.

verLessThan(toolbox, version) returns logical 1 (true) if the version of the toolbox specified by the string toolbox is older than the version specified by the string version, and logical 0 (false) otherwise.

The below examples illustrate the proper usage of the verLessThan function.

Example 1 - Checking For the Minimum Required Version

if verLessThan('simulink', '4.0')

error('Simulink 4.0 or higher is required.');

end

Example 2 - Choosing Which Code to Run

if verLessThan('matlab', '7.0.1')

% -- Put code to run under MATLAB 7.0.0 and earlier here --

else

% -- Put code to run under MATLAB 7.0.1 and later here --

end

Remarks
The verLessThan function is available with MATLAB Version 7.4. If you are running a version of MATLAB earlier than 7.4, you can download the verLessThan M-file from the following MathWorks Technical Support solution. You must be running MATLAB Version 6.0 or higher to use this M-file:
http://www.mathworks.com/support/solutions/data/1-38LI61.html?solution=1-38LI61

 

Debugging MATLAB M-files from the MATLAB Command Prompt

What Debugging Tools Are Available at the MATLAB Command Prompt?
This section describes how to make use of functions to debug programs from the MATLAB command prompt. There are altogether seven topics and in the e-newsletter issue, we will look at the sixth and seventh topic.

Topics
1. Setting, Clearing, and Querying Breakpoints
2. Moving from Workspace to Workspace
3. Executing Your Code Using the DBSTEP Function
4. Displaying Status Messages Periodically
5. Using the TRY/CATCH Block to Capture Errors
6. Using the ERROR Function with the LASTERR and RETHROW Functions
7. The WHICH Function

Topic 6: Using the ERROR Function with the LASTERR and RETHROW Functions
Inside your TRY/CATCH block, you may want to proceed differently based on which specific error message you received; for instance, trying to open a nonexistent file would lead to a

File not found

error. You may want to allow the user to select a new filename to open rather than proceeding or terminating the program completely. You can determine the specific error that triggered the CATCH block using the LASTERR function.

Alternatively, after performing your error cleanup inside the CATCH block, you may want to trigger the error that forced you into the CATCH block, to alert the user that something has gone wrong. You can do this using the ERROR function (which explicitly throws an error) in combination with the LASTERR function or with the functions RETHROW and LASTERROR.

You can see a sample function file that demonstrates the use of the LASTERR, LASTERROR, and RETHROW functions as follows:

 

Topic 7: The WHICH Function

The WHICH function will display the location of the first file on the MATLAB path whose name matches the string that was passed to WHICH. This function will also tell you if the string is the name of a variable in the current workspace or is the name of a built-in function. You can also provide the WHICH function an additional argument, the -ALL flag, which will list all the variables, built-in functions, and files whose names match the string provided to WHICH. This allows you to verify that you are using the correct version of a file when there may be multiple files with the same name on the MATLAB path.

One of the most common cases where the WHICH function is useful in finding a problem with your code occurs when attempting to call a function. If another function with that name is located higher on the MATLAB search path or a variable with the function name exists, MATLAB will use the other function or the value of the variable instead of the function you intend.

For example, if you define a variable why

 >> why = 1:10;

and attempt to call the MATLAB built-in WHY function

 >> why(37)

you will receive the following error:

??? Index exceeds matrix dimensions.

It is easy to use WHICH to find out whether why is a function or a variable. If you now type

 >> which why

you now see

why is a variable.

rather than what is expected

C:\MATLAB\R2007a\toolbox\matlab\elmat\why.m

 
 
EVENTS & TRAINING
 

Learn and do more with MATLAB & Simulink

'Applying Neural Network with MATLAB' training workshop

Workshop Highlights:
This 2-day hands-on course presents the basic concepts of neural computing and its implementation in MATLAB to the participants. Fundamental topics of neural networks are introduced, ranging from a brief introduction to the history of neural computing, concept of a single neuron, introduction to supervised neural networks such as perceptrons, linear networks, backpropagation networks and radial basis networks, to the introduction of unsupervised neural network, i.e. the self-organizing map. Hands-on demonstration and exercises are vital element of the course, with heavy emphasis on practical applications of neural networks. The ultimate aim of this course is to instill full appreciation of the powerful capability of MATLAB and the Neural Network Toolbox for the implementation of neural computing.

In-house or customized training is also available on request, please contact Activemedia at 6742-8173 for details. Other relevant training courses provided by Activemedia include:

- Comprehensive MATLAB
- Advanced MATLAB Programming Techniques
- Building GUIs with MATLAB
- Applying Image Processing Techniques with MATLAB and SIMULINK
- Applying Neural Network with MATLAB

 
 
Visit www.activemedia.com.sg or Contact us at:
Singapore:
(65) 6742 8173
enquiry@activemedia.com.sg
Malaysia:
(60) 3 7880 8522
enquiry@activemedia.com.my
Thailand:
(66) 2 612 9390-1
info@activemedia.in.th

 
 
Customer Applications
 

Yokogawa Electric Develops Key Components for Next-Generation Optical Networks with Simulink and Link for ModelSim

Download this user story 141k

To develop optical network devices for next-generation optical networks
Use MathWorks tools to develop the scheduling control system of an optical packet switch and to design and verify the signal processing algorithm of an optical media manager
• Development time halved
• Reliable test data generated
• Coding errors corrected before hardware testing
 


The expansion of broadband communication and multichannel digital television broadcasting has intensified the demand for high-speed networks. The routers, switches, and other networking technologies currently available do not function well at higher speeds. One solution is the optical packet network, a system in which data is transmitted over fiber optic lines as pulses of light.


Yokogawa's Optical Media Manager.

It will be several years before the first of these networks is available, but Yokogawa Electric Corporation has already developed two key optical network components. One is an ultra-high-speed optical switching device that helps prevent bottlenecks by enabling signals in optical circuits to be switched from one circuit to another. The other is an optical packet transmitter/receiver, known as Optical Media Manager, that provides an interface between the optical packet network and conventional networks.

Using MathWorks products and Model-Based Design, Yokogawa Electric reduced development time and costs by thoroughly testing these devices before prototyping them.

"End-to-end system development with Simulink has streamlined our current design flow," says Yokogawa development team manager Chie Sato. "We found virtually all bugs before hardware prototyping using Link for ModelSim, and this cut development time in half."

 

Challenge

Yokogawa Electric's optical packet switch would switch the packet's transfer route, "read" its label to determine its destination, and provide buffering and scheduling to prevent packet collision. The Optical Media Manager would work as a gateway between an optical packet network and Ethernet. It would provide functions for optical packet generation, reception, and labeling.

Development would focus on two key components of the system: a multiplexer/demultiplexer for packet data and error-correction code.

Yokogawa Electric would be designing the control logic and the hardware in parallel, reducing development time, but also increasing the risk of unexpected software problems during hardware prototyping.

The team needed software that would enable them to design, simulate, and test the control design with the hardware and implement it on FPGAs. They also needed to change specs during development without recoding, and to test the control software before prototyping.

"End-to-end system development with Simulink has streamlined our current design flow. We found virtually all bugs before hardware prototyping using Link for ModelSim, and this cut development time in half."

Chie Sato,
Yokogawa Electric

 

Solution

Yokogawa Electric modeled the multiplexer/demultiplexer and the error-correction code in Simulink and used Stateflow to model the optical packet switch's control circuit specifications, packet data traffic, and packet scheduling. After converting the components manually into HDL, they used Link for ModelSim to verify the control specifications. The engineers shared the Simulink model as they verified their individual HDL code.

Similarly, they developed the algorithm of the end-to-end Optical Media Manager in MATLAB and Simulink, designed each processing component individually with HDL, and integrated all components in the Simulink environment with Link for ModelSim. Using Simulink Fixed Point, they converted the model from floating point to fixed point and then simulated the entire system under various conditions to verify its behavior.

"By using Simulink to simulate our model, we verified the processing functionalities of the FPGA and determined the cause of design errors better than before," Sato explains.

The first version of the optical packet switch and Optical Media Manager were released on time and within budget.

Yokogawa Electric is now developing new versions of these components, again using MathWorks products and Model-Based Design. They also plan to use MathWorks tools to develop 40Gbps optical packet network systems focusing on LAN applications.

 

Results

  • Development time halved. "By creating system-level test benches in Simulink, our team avoided writing test benches in HDL, which can take several weeks," Sato explains. "With MathWorks products, two engineers completed development in almost under six weeks. It would have taken them more than three months without MathWorks tools."
     
  • Reliable test data generated. Data produced by measurement instruments such as Ethernet load generators is not always reliable enough to be used for verification. MathWorks tools and Model-Based Design helped ensure reliability by enabling Yokogawa to reuse the test data used in algorithm design.
     
  • Coding errors corrected before hardware testing. By generating flexible patterns of test signals, the team corrected virtually all bugs during simulation, which helped ensure that hardware testing proceeded smoothly.

Products Used

Fixed-Point Toolbox
Link for ModelSim®
MATLAB®
Simulink®
Simulink® Fixed Point
Stateflow®