1. Engineering
  2. Computer Science
  3. use matlab for exercise 1a z1 values z2 values y1...

Question: use matlab for exercise 1a z1 values z2 values y1...

Question details

Use Matlab

for exercise 1a. z1 values, z2 values, y1 values, y2 values, plotting, no legend

exercise 1b. Find N=2, N=5

Plot the function y = 42 for z-H, 8] (use a 0.1 spacing for z). Notice that the function has a vertical asymptote at z-2. Avoid plotting the asymptote itself: Create two vectors for the domain of z (z1 for before the asymptote and z2 for after). Calculate the corresponding y arrays (call them y1 and y2). Now appropriately plot all 4 arrays in the same plot: y1 vs z1 and y2 vs z2. (Note: the plotted series should be the same color to communicate that one function is plotted. This can be accomplished by adding a control string in the plot command. (If both series were instead plotted with one call to the plot function and no color indicator, the 2 series will appear with different colors by default-which would be incorrect.) There are other ways to accomplish what this problem is aksing for, but for the sake of passing the tests, do it using the method described Your Script C Reset MATLAB Documentation 2 4 6y2= []; create a user-defined function that, when given a value for the number of columns, will create a corresponding ROW vector of all 2s. The function should have one input and one output. Note: use the built-in MATLAB function ones () in your calculation Test your function using N 2 and N-5 Function specifications Function name: twos Input argument: N (an integer), the length of the 2s vector to be generated Output argument: A row vector of N 2s

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution