Çeşitli İngilizce öğretmenleri arasından arama yapın...
China flagLao Sun
Matlab Learning note Matlab Learning note In this chapter, I just try to write what I have learned when I tried to use MATLAB to solve some problems. My English is not very well, so there may be many syntax error in my note. But, I have to try to use English since I don't have much chance to speak and write, I have to use it in my ordinary life. Only in this way, I can improve the language skills. MATLAB is an useful and remarkable science calculating software. It can help me overcome most of problems I meat in my work, so I hope I can master it well. \section{Opening and loading files} \paragraph{fopen} FID=fopen(Filename) opens the file Filename for read access. The Filename is a string containing the name of the file to be opened. Filename can be a MATLABPATH relative partial pathname. If the file is not found in the current working directory,' fopen' will search for it on the MATLAB search path. FID is a MATLAB scalar integer valued double, called a file identifier. You use FID as the first argument to other file input/output routiness, such as FREAD and FCLOSE. If it can not open the file, it will return a '-1'. fopen(Filename,PERMISSION) opens files in the mode specified by PERMISSION: 'r' open for reading, 'w' open for writing, 'a' open or creating file for writing, append the date to the end of the file, 'r+' open (do not create ) file for reading and writing, 'w+' open or create file for reading and writing, discard the existing contents, 'a+' open or ceate file for reading and writing, append the data to the end of file, 'W' open file for writing without automatic flushing, 'A' open file for appending without automatic flushing \paragraph{fgetl}: fgetl read line from file with the line terminator, discard newline characters. Tline=fgetl(FID) returns the next line of a file associated with the file identifier FID as a MATLAB string. The line terminator is not included. \paragraph{fseek} : 'fseek' sets file position indicator. STATUS = fseek(FID,OFFSET,ORIGIN) repositions the file position indicators in the file associated with the FID. It sets the position indicators the byte specified OFFSET relative to the ORIGIN. OFFSET values:">=0" OFFSET bytes after ORIGIN,"<0" OFFSET bytes before ORIGIN ORIGIN values: '-1' beginning of file, 0 current position in file, 1 end of file For example: fseek(fid,0,-1) just rewinds the origin file.

Düzeltmeler · 0

Evden çıkmadan dil öğrenme fırsatını kaçırmayın. Deneyimli dil eğitmenlerimizden oluşan seçkimize göz atın ve ilk dersinize şimdi kaydolun!

Bugün öğrenmeye başlayın