Matlab: Working with files<br />
Writing files<br />To write a new file, use the function: <br />fid= fopen(‘&lt;filename&gt;’, ‘wt’);<br />To write to a n...
Writing files<br />Use the following set of commands to create a new file and write a sentence into that file. View the fi...
Writing files<br />
Writing files<br />To open a file in text mode, specify the permission using one of the listed Permission Value, and attac...
Reading Files<br />Use the command ‘fopen(‘&lt;filename&gt;, rt’) to open a file to be read in text mode. <br />Use the fs...
Reading Files<br />
Reading Files<br />
Shifting and Sorting matrices<br />Shift and Sort Functions<br />circshift	Circularly shift matrix contents.<br />sortSort...
Shifting and Sorting matrices<br />
Visit more self help tutorials<br />Pick a tutorial of your choice and browse through it at your own pace.<br />The tutori...
Upcoming SlideShare
Loading in...5
×

Matlab Text Files

3,360

Published on

Matlab Text Files

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,360
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Matlab Text Files"

  1. 1. Matlab: Working with files<br />
  2. 2. Writing files<br />To write a new file, use the function: <br />fid= fopen(‘&lt;filename&gt;’, ‘wt’);<br />To write to a new file, use the function:<br />fprintf(fid, ‘Hello, I am writing this into the file’);<br />
  3. 3. Writing files<br />Use the following set of commands to create a new file and write a sentence into that file. View the file in notepad. <br />
  4. 4. Writing files<br />
  5. 5. Writing files<br />To open a file in text mode, specify the permission using one of the listed Permission Value, and attach the letter &apos;t&apos;. For example, use &apos;rt&apos; or &apos;wt+&apos;.<br />
  6. 6. Reading Files<br />Use the command ‘fopen(‘&lt;filename&gt;, rt’) to open a file to be read in text mode. <br />Use the fscanf(fid, format, size)command to read form the file. <br />
  7. 7. Reading Files<br />
  8. 8. Reading Files<br />
  9. 9. Shifting and Sorting matrices<br />Shift and Sort Functions<br />circshift Circularly shift matrix contents.<br />sortSort array elements in ascending or descending order.<br />sortrows Sort rows in ascending order.<br />issorted Determine if matrix elements are in sorted order.<br />
  10. 10. Shifting and Sorting matrices<br />
  11. 11. Visit more self help tutorials<br />Pick a tutorial of your choice and browse through it at your own pace.<br />The tutorials section is free, self-guiding and will not involve any additional support.<br />Visit us at www.dataminingtools.net<br />

×