Question
MATLAB: You are to create a cell array called cellar that contains the following: [sin] [[0][2 ][ / 100]] [0 1 1 0] [cos] [[-][][
MATLAB:
You are to create a cell array called cellar that contains the following: [sin] [[0][2 ][ / 100]] [0 1 1 0] [cos] [[-][][ / 15]] [0 0 0 1] [tan] [[- / 2.2][ / 2.2][ / 20]] [0 1 1 0] [atan] [[-10][10][0.02]] [1 1 1 0] [acot] [[-8][8][0.05]] [0 1 0 1] [exp] [[-5][10][0.1]] [1 1 0 1] [log] [[0.1][8.5][0.5]] [0 0 1 1]
Each row of the cell array cellar should have the following structure:
[function name] [[min][max ][step]] [vector]
The first cell of each row contains a string representation of a MATLAB build-in function; the second cell stores three sub-cells, containing numerical values which specify the beginning of an interval, the end of an interval, and the interval discretization size, respectively; the third cell contains a logical row vector.
(a) Create the cell array cellar described above. Without assuming the number of rows of the cell array cellar:
(e) swap the third cell in the first row with the third cell in the second row of the cell array,
(f) swap the fifth and sixth rows of the cell array,
(g) assign to variable x a row vector of regularly spaced values from min to max using step as the increment between elements, where min, max, and step are values obtained from the corresponding sub-cells of the second cell of the seventh row of the cell array,
(h) plot the function specified by the string stored in the first cell of the seventh row of the cell array versus vector x that was generated in part (g),
(i) by looping through the rows of the cell array, plot each function (in a separate figure window) whose name is given as a string in the first cell of the corresponding row. Each function should be plotted over the interval specified by the values min and max contained in the first two sub-cells of the second cell of the corresponding row. Use the value step contained in the third sub-cell as the step size. (In other words, repeat part (h) for all rows of the cell array.)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started