Pass Complex Data to MATLAB from C# Client

2 Ansichten (letzte 30 Tage)
Katelyn Heejeong Park
Katelyn Heejeong Park am 21 Sep. 2016
Bearbeitet: Mudambi Srivatsa am 28 Sep. 2016
I have seen the example of passing arrays to Matlab from C# Client, which was very helpful. Can I pass a matrix or a table to Matlab from C# Client?

Antworten (1)

Mudambi Srivatsa
Mudambi Srivatsa am 28 Sep. 2016
Bearbeitet: Mudambi Srivatsa am 28 Sep. 2016
Yes, you can pass a matrix from C# client to MATLAB using "PutFullMatrix" function. Refer to the following documentation page that explains how to pass matrices to MATLAB from a C# client.
https://www.mathworks.com/help/matlab/matlab_external/call-matlab-function-from-a-c-client.html
Further, you can read the matrix into C# program using "GetFullMatrix" as illustrated in the documentation. For more information on "PutFullMatrix" and "GetFullMatrix" functions, refer to the following documentation links:
https://www.mathworks.com/help/matlab/ref/putfullmatrix.html
https://www.mathworks.com/help/matlab/ref/getfullmatrix.html
The example in the documentation discusses matrices with complex data. You can pass an empty SAFEARRAY as the last argument to "PutFullMatrix" function to create real matrices.
Note that the matrix sent to MATLAB from C# client cannot be a scalar, an empty array, or have more than two dimensions. To use higher dimensional matrices, reshape the matrix to a 2D matrix before sending it to the MATLAB server. Then change the dimensions back after receiving it from MATLAB.

Kategorien

Mehr zu Write COM Applications to Work with MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by