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

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 408
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 281
6 Importing and Exporting Data
6-26
C
C Copy integer to character string
C
do 20 i=1,ndir
call mxCopyPtrToCharacter(adir(i), names(i), 32)
20 continue
C
write(6,*) 'Directory of Mat-file:'
do 30 i=1,ndir
write(6,*) names(i)
30 continue
C
stat = matClose(mp)
if (stat .ne. 0) then
write(6,*) 'Error closing ''matdemo.mat''.'
stop
end if
C
C-------------------------------------------------------------
C Reopen file and read full arrays.
C-------------------------------------------------------------
C
mp = matOpen('matdemo.mat', 'r')
if (mp .eq. 0) then
write(6,*) 'Can''t open ''matdemo.mat''.'
stop
end if
C
C Read directory.
C
write(6,*) 'Getting full array contents:'
pa = matGetNextMatrix(mp)
do while (pa .ne. 0)
C
C Copy name to character string.
C
name = mxGetName(pa)
write(6,*) 'Retrieved ', name
write(6,*) ' With size ', mxGetM(pa), '-by-', mxGetN(pa)
pa = matGetNextMatrix(mp)
Przeglądanie stron 281
1 2 ... 277 278 279 280 281 282 283 284 285 286 287 ... 407 408

Komentarze do niniejszej Instrukcji

Brak uwag