Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Wiki Markup
This will read in _\[A\]_ from the specified file. Let's test this at the command line before we add it to our program: !dlmread.jpg!
Check A in the Workspace. Note that each line in the text file is interpreted as a matrix 

Image Added

Check A in the Workspace. Note that each line in the text file is interpreted as a matrix row.

We'll create a new program called beam4.m starting from beam3.m. Select beam3.m in the Editor. Select

...

Enter beam4.m for filename. Confirm that you are editing beam4.m. Comment out the original A specification statement and replace it with the above statement using dlmread. Add a semi-colon at the end of the statement.

Save beam4.m. Run it from the command line.

Does your result look right?

...

Wiki Markup
Append the elements of _\[B\]_ to _input_data.txt_ and save the file: !input_data2.jpg!
Now we need to tell MATLAB 

Image Added

Now we need to tell MATLAB to:

  1. Read in the first two rows and assign it to A.
  2. Read in the last two rows and assign it to B.

...