MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Manual de usuario Pagina 74

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 408
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 73
2 Creating C Language MEX-Files
2-14
and so on. Likewise, prhs[0] contains a pointer to the first right-hand side
argument,
prhs[1] points to the second, and so on.
This example,
xtimesy, multiplies an input scalar by an input scalar or matrix
and outputs a matrix. For example, using
xtimesy with two scalars gives
x = 7;
y = 7;
z = xtimesy(x,y)
z =
49
Using xtimesy with a scalar and a matrix gives
x = 9;
y = ones(3);
z = xtimesy(x,y)
z =
9 9 9
9 9 9
9 9 9
This is the corresponding MEX-file C code.
#include "mex.h"
/*
* xtimesy.c - example found in API guide
*
* Multiplies an input scalar times an input matrix and outputs a
* matrix.
*
* This is a MEX-file for MATLAB.
* Copyright (c) 1984-2000 The MathWorks, Inc.
*/
/* $Revision: 1.10 $ */
Vista de pagina 73
1 2 ... 69 70 71 72 73 74 75 76 77 78 79 ... 407 408

Comentarios a estos manuales

Sin comentarios