Facebook
From ffe, 8 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 255
  1.  
  2. function citaj_podatke()
  3.     ime_datoteke = 'Studenti.txt';
  4.     fid = fopen(ime_datoteke, 'r');
  5.  
  6.     if fid == -1
  7.         error('Nije moguce otvoriti datoteku za citanje.');
  8.     end
  9.  
  10.     fprintf('\nPodaci u datoteci %s:\n', ime_datoteke);
  11.     while ~feof(fid)
  12.         linija = fgetl(fid);  
  13.         disp(linija);  
  14.     end
  15.    
  16.     fclose(fid);
  17. end
  18.