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

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 408
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 270
Examples of MAT-Files
6-15
pa2 = matGetArray(pmat, "GlobalDouble");
if (pa2 == NULL) {
printf("Error reading existing matrix GlobalDouble\n");
return(EXIT_FAILURE);
}
if (!(mxIsFromGlobalWS(pa2))) {
printf("Error saving global matrix: result is not global\n");
return(EXIT_FAILURE);
}
pa3 = matGetArray(pmat, "LocalString");
if (pa3 == NULL) {
printf("Error reading existing matrix LocalDouble\n");
return(EXIT_FAILURE);
}
status = mxGetString(pa3, str, sizeof(str));
if(status != 0) {
printf("Not enough space. String is truncated.");
return(EXIT_FAILURE);
}
if (strcmp(str, "MATLAB: the language of technical
computing")) {
printf("Error saving string: result has incorrect
contents\n");
return(EXIT_FAILURE);
}
/* clean up before exit */
mxDestroyArray(pa1);
mxDestroyArray(pa2);
mxDestroyArray(pa3);
if (matClose(pmat) != 0) {
printf("Error closing file %s\n",file);
return(EXIT_FAILURE);
}
printf("Done\n");
return(EXIT_SUCCESS);
}
Przeglądanie stron 270
1 2 ... 266 267 268 269 270 271 272 273 274 275 276 ... 407 408

Komentarze do niniejszej Instrukcji

Brak uwag