week06 - Rutgers University School of Engineering Spring...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Rutgers University School of Engineering Spring 2012 14:440:127 - Introduction to Computers for Engineers Sophocles J. Orfanidis ECE Department [email protected] week 6
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Week 1 Week 2 Week 3 - Matrices (ch. 4) Week 4 - Plotting – 2D and 3D plots (ch. 5) Week 5 - User-defined functions (ch. 6) – Exam 1 Week 6 - Input-output formatting – fprintf, fscanf (ch. 7) Week 7 Week 8 Week 9 - Matrix algebra – solving linear equations (ch. 10) Week 10 - Cell arrays and structures (ch. 11) – Exam 2 Week 11 - Numerical methods – part I (ch. 13) Week 12 - Numerical methods – part II (ch. 13) Week 13 - Symbolic toolbox (ch. 12) Week 14 - Exam 3 Weekly Topics Textbook: H. Moore, MATLAB for Engineers , 3 d ed., Prentice Hall, 2011
Background image of page 2
Input – Output Processing input and output functions, input, disp saving and loading files and variables, save, load formatted screen output, fprintf, sprintf file input and output opening, reading, writing, and saving files fopen, fclose, frewind fprintf, fscanf, fgetl, textscan reading and writing excel files reading, writing, playing audio files reading and displaying image files
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
MATLAB has a large number of file processing functions for a variety of tasks: 1. file opening, loading, saving 2. text file processing 3. low-level file I/O 4. reading, writing spreadsheets 5. audio and video file processing 7. specialized scientific data formats 8. file compression and internet file access 9. XML files
Background image of page 4
Useful I/O Functions: input, disp, num2str load, save fprintf, sprintf fopen, fclose, frewind, fread, fwrite fscanf, textscan, fgetl, importdata xlsread, xlswrite sound, wavread, wavwrite, wavplay, wavfinfo, wavrecord, audioplayer, audiorecorder, auidodevinfo imread, imwrite, image, imfinfo, im2java zip, unzip, tar, untar, gzip, gunzip >> help iofun >> doc iofun
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
>> x = 10; disp('the value of x is:'); disp(x); the value of x is: 10 >> x = input('enter x: ') % numerical input enter x: 100 % 100 entered by user x = 100 >> y = input('enter string: ', 's'); % string input enter string: abcd efg >> y = input('enter string: ') enter string: 'abcd efg' y = abcd efg input/output functions: disp , input prompt string in single quotes string entered with no quotes string entered in quotes >> doc disp >> doc input
Background image of page 6
prompt = 'enter a 2x2 matrix A = '; A = input(prompt) enter a 2x2 matrix A = [1 2; 3 4] A = 1 2 3 4 N=3; M=2; prompt = ['enter a', . .. num2str(N),'x',num2str(M),' matrix A = ']; A = input(prompt) enter a 3x2 matrix A = [1 2; 3 4; 5 6] A = 1 2 3 4 5 6 brackets are required >> doc num2str >> doc int2str using num2str
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
save, load >> doc save >> doc load Y = [1 2 3 4; 5 6 7 8]; save('test.dat', 'Y', '-ascii'); % text file save test.dat Y –ascii;
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/26/2012 for the course ENGINEERIN 440:127 taught by Professor Blase during the Spring '10 term at Rutgers.

Page1 / 45

week06 - Rutgers University School of Engineering Spring...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online