MATLAB COMPILER RELEASE NOTES Betriebsanweisung Seite 110

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 264
  • Inhaltsverzeichnis
  • FEHLERBEHEBUNG
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 109
4 Stand-Alone Applications
4-40
mrankp.c
Thecodeinmrankp.c calls mrank and outputs the values that mrank returns.
/*
* MRANKP.C
* "Posix" C main program illustrating the use of the MATLAB Math
* Library.
* Calls mlfMrank, obtained by using MCC to compile mrank.m.
*
* $Revision: 1.3 $
*
*/
#include <stdio.h>
#include <math.h>
#include "matlab.h"
/* Prototype for mlfMrank */
extern mxArray *mlfMrank( mxArray * );
main( int argc, char **argv )
{
mxArray *N; /* Matrix containing n. */
mxArray *R; /* Result matrix. */
int n; /* Integer parameter from command line. */
/* Get any command line parameter. */
if (argc >= 2) {
n = atoi(argv[1]);
} else {
n = 12;
}
PkgInitialize(); /* Initialize the library of M-Functions */
/* Create a 1-by-1 matrix containing n. */
N = mlfScalar(n);
/* Call mlfMrank, the compiled version of mrank.m. */
R = mlfMrank(N);
Seitenansicht 109
1 2 ... 105 106 107 108 109 110 111 112 113 114 115 ... 263 264

Kommentare zu diesen Handbüchern

Keine Kommentare