You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Lag en funksjon som tar inn et filnavn, åpner filen og skriver innholdet ut i Command Window.

 

function readAndPrintFile( filename)
    fid = fopen(filename, 'r');
    while(  ~ feof( fid))
    line = fgetl(fid);
        fprintf('%s', line);
    end
    fclose(fid);
end

 

 

 

  • No labels