Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
MATLAB là trường hợp nhạy cảm, có nghĩa là nó phân biệt giữa các chữ cái trên và chữ thường. Vì vậy, sự cân bằng, CÂN và cân bằng được ba biến số khác nhau. Nhiều người lập trình viết các tên biến trong chữ thường, ngoại trừ chữ cái đầu của | 4 MATLAB functions data import-export utilities variables. You can for example import data from an Excel spreadsheet in this way. If the data are numeric with row and column headers the Import Wizard imports the numericdatainto anumericarrayandtheheadersinto a cell array. Neat isn t it 4.2.6 Low-level file I O functions MATLABhasa setoflow-levelfile l O input output functions based on the I O functions of the ANSI standard c Library. You would typically use these functions to access binary datawrittea eat or Javateugrams. fouyxamply.C r toacouas a database whichisCoolargc to beloadedindo taeworksexceinitseaniretx. c programmers ehouldnate that taeMAnutB filel OaammanCs are nat ll identical to their c counterparts. For example fread is vectorized i.e. it reads until it encounrersataar stringor uheentof sit. Files can be acctesed wfth tliuao.unctionc in textorbinarymoOe. In binary mode you can think of the file as a long continuous stream of bytes which are your responsibilityta lntorereOcorrnetly. Fllec tatnedlnbinary mode eau be accessed randomly i.o. you cstnpeclty atweice J rocalurr t aou weat Oh start reading or writing. The short programs wtich follxw sliow how to create a file in binary mode how to read it and how to change it. Explanations of new features follow each program. You willseedOx coaoxlt tae onlisedocemsatetion and heep te see the wide range otoetlontaaallabla fsrthosalOOtunceats. Writing binarydata The example we aregpi g to use hasawide variety of applications. We want to set up a database of records each record consisting of information about individuals clients 11111X1 5 1x150. lutl iisatamale eaat eexord wiUtyvaa student s name atd xye mnrn. The Ohrm recorfasx pa ual uigaifichoca in MATLAB as it taiSa for tuamplx.laaascaLitisused hera taa coaveniynt way of thinking ontheUaniuuait ina Outatem. The following progrwM writur .ml rnvitesyxu Coentar ee umber of names and marks from the command line and writes them as binary data to a file. To .