How do I perform array assignment using the MATLAB C Math Library?

1 Ansicht (letzte 30 Tage)
I would like to know the C Math Library equivalent operator for the following MATLAB array element assignment:
A(2,3) = 19;

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 27 Jun. 2009
The MATLAB C Math Library includes a utility function called mlfIndexAssign that enables operations similar to MATLAB's array element assignment.
The following code illustrates the use of this function:
/* In MATLAB: A(2,3) = 19 */
mxArray *A = NULL;
mlfIndexAssign(&A, /* Destination array */
"(?,?)", /* Index format string */
mlfScalar(2), /* Subscript value */
mlfScalar(3), /* Subscript value */
mlfScalar(19)); /* Source array */

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays 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