...
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 |
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 |
Now we need to tell MATLAB to:
- Read in the first two rows and assign it to A.
- Read in the last two rows and assign it to B.
...