
| Contents | Index |
• Desktop Tools and Development Environment
• Graphics
• Creating Graphical User Interfaces
Handle Graphics Property Browser
• Read and Write MATLAB MAT-Files in C/C++ and Fortran
• Calling C Shared Library Functions from MATLAB
• Creating C/C++ and Fortran Programs to be Callable from MATLAB (MEX-Files)
• Creating C/C++ Language MEX-Files
• Calling MATLAB Engine from C/C++ and Fortran Programs
• Using Java Libraries from MATLAB
• Using .NET Libraries from MATLAB
• Pass System.String Arguments
• Pass System.Nullable Arguments
Use .NET Properties That Take Arguments
MATLAB Does Not Display Protected Properties or Fields
• Tips for Working with Cell Arrays of .NET Data
Example of Cell Arrays of .NET Data
Create a Cell Array for Each System.Object
• Using COM Objects from MATLAB
The MATLAB COM Automation Server
Registering Controls and Servers
Overview of MATLAB COM Client Examples
Example - Using Internet Explorer Program in a MATLAB Figure
Example - Grid ActiveX Control in a Figure
Example - Reading Excel Spreadsheet Data
MATLAB Client and In-Process Server
MATLAB Client and Out-of-Process Server
COM Implementations Supported by MATLAB Software
Creating the Server Process - An Overview
Identifying Objects and Interfaces
Setting the Value of a Property
Using Enumerated Values for Properties
Properties That Take Arguments
Exceptions to Using Implicit Syntax
Specifying Enumerated Parameters
Returning Multiple Output Arguments
Argument Callouts in Error Messages
Functions for Working with Events
Responding to Events - an Overview
Responding to Events - Examples
Writing Event Handlers as MATLAB File Subfunctions
Releasing COM Interfaces and Objects
Handling Data from a COM Object
Passing MATLAB Data to ActiveX Objects
Passing MATLAB SAFEARRAY to COM Object
Reading SAFEARRAY from a COM Object in MATLAB Applications
Displaying MATLAB Syntax for COM Objects
Using a MATLAB Application as an Automation Client
Connecting to an Existing Excel Application
Running a Macro in an Excel Server Application
Using Microsoft Forms 2.0 Controls
• Calling MATLAB COM Automation Server
• Using Web Services with MATLAB
What Are Web Services in MATLAB?
What You Need to Use Web Services with MATLAB
What Is the MATLAB Serial Port Interface?
Supported Serial Port Interface Standards
Using the Examples with Your Device
The Serial Port Interface Standard
Connecting Two Devices with a Serial Cable
Serial Port Signals and Pin Assignments
Finding Serial Port Information for Your Platform
Using Virtual USB Serial Ports
Configuring and Returning Properties
Configuring Properties During Object Creation
The Serial Port Object Display
Creating an Array of Serial Port Objects
Example - Introduction to Writing and Reading Data
Controlling Access to the MATLAB Command Line
Example - Writing and Reading Text Data
Example - Parsing Input Data Using textscan
Example - Introduction to Events and Callbacks
Event Types and Callback Properties
Responding To Event Information
Creating and Executing Callback Functions
Enabling Callback Functions After They Error
Example - Using Events and Callbacks
Signaling the Presence of Connected Devices
Controlling the Flow of Data: Handshaking
Example: Introduction to Recording Information
Creating Multiple Record Files
Example: Recording Information to Disk
Using Serial Port Objects on Different Platforms
• Examples
| On this page… |
|---|
Example of Cell Arrays of .NET Data Create a Cell Array for Each System.Object |
In the Converting Nested System.Object Arrays example, the cell array mlData contains data from the MyGraph.getNewData method. By reading the class documentation in the source file, you can create the following MATLAB graph:
NET.addAssembly('c:\work\NetDocCell.dll');
obj = NetDocCell.MyGraph;
% Create cell array containing all data
mlData = cell(obj.getNewData);
% Plot the data and label the graph
figure('Name',char(mlData{1}));
plot(double(mlData{2}(2)))
xlabel(char(mlData{2}(1)));However, keeping track of data of different types and dimensions and the conversions necessary to map .NET data into MATLAB types is complicated using the cell array structure. Here are some tips for working with the contents of nested System.Object arrays in MATLAB. After reading data from a .NET method:
Create cell arrays for all System.Object arrays.
Convert the .NET types to MATLAB types, according to the information in Handling Data Returned from a .NET Object.
Create MATLAB variables for each type within the cell arrays.
Call MATLAB functions with the MATLAB variables.
The following statement creates the cell array mlData:
mlData = cell(obj.getNewData)
This cell array contains elements of the following type:
mlData =
[1x1 System.String] [1x1 System.Object[]]To access the contents of the System.Object array, create another cell array mlPlotData:
mlPlotData = cell(mlData{2})This cell array contains elements of the following type:
mlPlotData =
[1x1 System.String] [1x1 System.Double[]]
Assign cell data to MATLAB variables and convert:
% Create descriptive variables
% Convert System.String to char
mytitle = char(mlData{1});
myxlabel = char(mlPlotData{1});
% Convert System.Double to double
y = double(mlPlotData{2});Create a MATLAB graph with this data:
% Remove the previous figure
close
% Plot the data and label the graph
figure('Name',mytitle,'NumberTitle','off');
plot(y)
xlabel(myxlabel);
![]() | Examples Using .NET Methods | An Assembly is a Library of .NET Classes | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A; sessions led by MATLAB experts.
| © 1984-2011- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |
Store


