MATLAB Release Notes |
External Interfaces/API Features
Concatenation of Java Arrays
In MATLAB 6.1, you can concatenate arrays of Java objects that have unlike dimensions. The following example concatenates a 2-by-3 array of java.lang.Integer
with a 4-by-3 array of the same class.
A = java.lang.Integer[][]: [ 1] [ 2] [ 3] [ 4] [ 5] [ 6] [17] [18] [19] [20] [21] [22] B = java.lang.Integer[][]: [11] [12] [13] [14] [15] [16]
The vertical concatenation [A;B]
is simple since both arrays have the same number of columns. The horizontal concatenation [A B]
merges the two arrays into an irregularly shaped array having six columns in the first and second rows and three columns in the third and fourth rows.
C = [A;B] C = [A B] C = C = java.lang.Integer[][]: java.lang.Integer[][]: [ 1] [ 2] [ 3] [6 element array] [ 4] [ 5] [ 6] [6 element array] [11] [12] [13] [3 element array] [14] [15] [16] [3 element array] [17] [18] [19] [20] [21] [22]
Note Concatenation of Java Objects discusses changes to how Java objects are concatenated. |
New Fortran MX, MEX, MAT, and ENG Functions
The following functions have been added to the Fortran MX, MEX, MAT, and Engine external interface. Most of these functions already exist in the MATLAB C language API.
mexFunctionName |
mexGetArray |
mexGetArrayPtr |
mexIsGlobal |
mexIsLocked |
mexLock |
mexMakeArrayPersistant |
mexMakeMemoryPersistant |
mexPutArray |
mexUnlock |
mexWarnMsgTxt |
|
matDeleteArray |
matGetArray |
matGetArrayHeader |
matGetNextArray |
matGetNextArrayHeader |
matPutArray |
matPutArrayAsGlobal |
|
engGetArray |
engPutArray |
Property Added to ActiveX and Engine Interfaces
For ActiveX automation server applications and MATLAB Engine applications running on Windows, you can control whether the application windows appear on the Windows desktop with a new property called Visible
.
When Visible
is set, the ActiveX application or engine server window is visible on the desktop, thus enabling user interaction with the server. This is the default. When Visible
is cleared, the application or engine window is removed from the desktop.
ActiveX. This example disables the visibility of an ActiveX automation server application by setting h.visible
to 0
. It checks the visibility setting in line 3 by examining h.visible
.
MATLAB Engine. For a MATLAB engine session, use the engSetVisible
and engGetVisible
functions that are new in MATLAB 6.1. Line 4, below, disables the visibility of the MATLAB engine window using engSetVisible
with an argument of 0
. Line 5 checks this setting with engGetVisible
.
Serial I/O
The MATLAB serial port interface provides direct access to peripheral devices such as modems, printers, and scientific instruments that you connect to your computer's serial port. This interface is established through a serial port object, which you create with the serial
function.
Freeing the Serial Port on Windows Platforms. The serial port object uses the javax.comm
package to communicate with the serial port. However, due to a memory leak in javax.comm
, the serial port object is not released from memory. You can use the freeserial
function to release the MATLAB hold on the serial port.
freeserial
is necessary only on Windows platforms. You should use freeserial
only if you need to connect to the serial port from another application after a serial port object has been connected to that port, and you do not want to exit MATLAB.
Events, Callbacks, and Function Handles. Action properties and action functions are now referred to as callback properties and callback functions. This new terminology is reflected in new names for the associated properties and functions. The general rule for the name changes is to change "Action" to "Fcn" for properties, and "action" to "callback" for functions. For example, TimerAction
has been renamed TimerFcn
, and instraction
has been renamed instrcallback
.
Additionally, if you want to automatically pass the object and event information to the callback function, then you must specify the function as either a function handle or as a cell array. Note that you can also specify the callback function as a string. In this case, the callback is evaluated in the MATLAB workspace and no requirements are made on the function's input arguments.
Enhancements to Existing Properties.
Terminator
Property - You can configure Terminator
to a decimal value ranging from 0 to 127, to the equivalent ASCII character, to CR/LF
or LF/CR
, or to empty ('').
TimerPeriod
value is too small. The minimum TimerPeriod
value is now 0.01 second.
OpenGL Renderer Feature -- Microsoft Windows | Creating Graphical User Interfaces -- GUIDE |