Ch5_6 - 1 Section 5.6: Data Input From a File First, create...

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

View Full Document Right Arrow Icon
Next Previous Section 5.6: Data Input From a File 11 ® First, create a text file using wordpad or notepad ® xandydata.txt with same data as last example ® make sure you save it in the correct directory ® for example: c:\WINDOWS\Desktop\matlabfiles Section 5.6: Data Input From a File
Background image of page 1

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

View Full DocumentRight Arrow Icon
Next Previous Section 5.6: Data Input From a File 22 clear : clears the workspace load xandydata.txt , loads the data and puts it into a matrix variable “xandydata whos : shows the variable list typing xandydata echo prints the variable to the screen The MatLab load command
Background image of page 2
Next Previous Section 5.6: Data Input From a File 33 Once you have input the data into the MatLab workspace, you can assign it to other variables (1, : ) means row 1 and all columns (2, : ) means row 2 and all columns Type the name of the new variables and they echo print to the screen. Extracting data from a matrix
Background image of page 3

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

View Full DocumentRight Arrow Icon
Next Previous Section 5.6: Data Input From a File 44 ® When working in command line mode: ® you can save your workspace (variables and their values) ®
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 11

Ch5_6 - 1 Section 5.6: Data Input From a File First, create...

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

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