Contenuto principale

Lettura di file MAT in C/C++

R2026b

L'esempio matdgns.c illustra come utilizzare le routine della libreria per leggere e analizzare un file MAT. Per visualizzare il codice, aprire il file nell'Editor di MATLAB®.

Dopo aver compilato il programma, eseguire l'applicazione. Questo programma legge il file MAT mattest.mat creato dall'esempio Create MAT File in C or C++. Per eseguire l'applicazione, a seconda della piattaforma in uso, fare doppio clic sull'icona oppure inserire matdgns al prompt di sistema.

matdgns mattest.mat
Reading file mattest.mat...
 
Directory of mattest.mat:
GlobalDouble
LocalString
LocalDouble
 
Examining the header for each variable:
According to its header, array GlobalDouble has 2 dimensions
  and was a global variable when saved
According to its header, array LocalString has 2 dimensions
  and was a local variable when saved
According to its header, array LocalDouble has 2 dimensions
  and was a local variable when saved
 
Reading in the actual array contents:
According to its contents, array GlobalDouble has 2 dimensions
  and was a global variable when saved
According to its contents, array LocalString has 2 dimensions
  and was a local variable when saved
According to its contents, array LocalDouble has 2 dimensions
  and was a local variable when saved
Done

Vedi anche

Argomenti