Compress all the files as a single .zip file and upload to Blackboard. Complete the following tasks in MATLAB, and save all the .m files along with all the output .dat files (i.e. save(‘A1.dat’, ‘A1’, ‘-ascii’)). For all open-ended questions, write clear responses in LaTeX.
Problem 1: Practice with Loops and Vectors
(a) Using a for-loop, find all the odd numbers from 1 to 100 and store it as a vector called x. Save x in the file A1.dat.
(b) Using a for-loop, find all the even numbers from −1 to −100 and store it as a vector called y. Save
y in the file A2.dat
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
30 | 31 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 1 | 2 | 3 |
Get Free Quote!
332 Experts Online