MATLAB APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE Guide de l'utilisateur Page 163

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 354
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 162
Using C/C++ Shared Libraries on M ac OS X
*
*================================ =============================*/
#include <stdio.h>
#ifdef __APPLE_CC__
#include <CoreFoundati on/C oreFoundation.h>
#endif
/* Include the MCR header file and the library specific header
* file as generated by MATLAB Compiler */
#include "libmatrix.h"
/* This function displays double matrix stored in mxArray */
void display(const mxArray* in);
void *run_main(void *x)
{
int *err = x;
mxArray *in1, *in2; /* Define input parameters */
mxArray *out = NULL;/* and output parameters to be passed to
* the library functions */
double data[] = {1,2,3,4,5,6,7,8,9};
/* Call the mclInitializeApplication rou tine . Make sure that
* the application was initialized properly by checking the
* return status. This initialization has to be done before
* calling any MATLAB API's or MATLAB Compiler generated
* shared library functions. */
if( !mclInitializeApp lica tion(NULL,0) )
{
fprintf(stderr, "Coul d not initializ e application.\n");
*err = -1;
return(x);
}
/* Create the input data */
in1 = mxCreateDoubleMatrix(3, 3,mxREAL);
in2 = mxCreateDoubleMatrix(3, 3,mxREAL);
7-33
Vue de la page 162
1 2 ... 158 159 160 161 162 163 164 165 166 167 168 ... 353 354

Commentaires sur ces manuels

Pas de commentaire