MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Manual do Utilizador Página 74

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 408
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 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 página 73
1 2 ... 69 70 71 72 73 74 75 76 77 78 79 ... 407 408

Comentários a estes Manuais

Sem comentários