MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Instrukcja Użytkownika Strona 269

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 408
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 268
Examples of MAT-Files
6-13
pa3 = mxCreateString("MATLAB: the language of technical
computing");
if (pa3 == NULL) {
printf("%s : Out of memory on line %d\n",
__FILE__, __LINE__);
printf("Unable to create string mxArray.\n");
return(EXIT_FAILURE);
}
mxSetName(pa3, "LocalString");
status = matPutArray(pmat, pa1);
if (status != 0) {
printf("%s : Error using matPutArray on line %d\n",
__FILE__, __LINE__);
return(EXIT_FAILURE);
}
status = matPutArrayAsGlobal(pmat, pa2);
if (status != 0) {
printf("Error using matPutArrayAsGlobal\n");
return(EXIT_FAILURE);
}
status = matPutArray(pmat, pa3);
if (status != 0) {
printf("%s : Error using matPutArray on line %d\n",
__FILE__, __LINE__);
return(EXIT_FAILURE);
}
/*
* Ooops! we need to copy data before writing the array. (Well,
* ok, this was really intentional.) This demonstrates that
* matPutArray will overwrite an existing array in a MAT-file.
*/
memcpy((void *)(mxGetPr(pa1)), (void *)data, sizeof(data));
status = matPutArray(pmat, pa1);
Przeglądanie stron 268
1 2 ... 264 265 266 267 268 269 270 271 272 273 274 ... 407 408

Komentarze do niniejszej Instrukcji

Brak uwag