Question

Using Matlab please answer problem 1, part a . Please explain for part a. 1. MATLAB...

Using Matlab please answer problem 1, part a . Please explain for part a.

1. MATLAB Script Files

(a) Experiment with vectors in MATLAB. Try the following:

iset = -3 :11;

iset

cos( pi*iset/4)

Explain how the last example computes the different values of cosine without a loop.

Homework Answers

Answer #1

iset = -3:11 gives a vector starting from -3 to 11 with step sie of 1

iset =

   -3   -2   -1    0    1    2    3    4    5    6    7    8    9   10   11

cos(pi*iset/4)

to explain this

first iset/4 gives a vector of same length iset but each element will be divided by 4

pi*(iset/4) multiples each element of iset/4 with pi

cos(pi*iset/4) computes cos of each element of pi*iset/4 and produces the result

here pi*iset/4 is a vector

evaluating a function with vector gives a vector

cos(pi*iset/4) =

ans =

 Columns 1 through 6:

  -7.0711e-01   6.1232e-17   7.0711e-01   1.0000e+00   7.0711e-01   6.1232e-17

 Columns 7 through 12:

  -7.0711e-01  -1.0000e+00  -7.0711e-01  -1.8370e-16   7.0711e-01   1.0000e+00

 Columns 13 through 15:

   7.0711e-01   3.0616e-16  -7.0711e-01
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Using Matlab please answer problem 1, parts a and b. Please explain each for part a....
Using Matlab please answer problem 1, parts a and b. Please explain each for part a. Please explain the result for part b. 1. MATLAB ARRAY INDEXING (a) Explain what the each of the following will produce: jk1 = 2:4:17       jk1 = 99:-1:88 ttt = 2:(1/9):4 (b) Extract or insert numbers in a vector. Try the following: xx= [ ones(1,4), [2:2:11], zeros(1,3) ] xx(3:7) length(xx) Explain the result.
let us create a variable for a row vector a = [1, 4, 1, 3, 2,...
let us create a variable for a row vector a = [1, 4, 1, 3, 2, 5, 0] and calculate the mean value of its elements using the Matlab function ‘mean’ and store this value in variable aMean. Fig. 1 gives the Matlab code to do this. a = [1, 4, 1, 3, 2, 5, 0]; aMean = mean(a); Figure 1: Matlab code – row vector and mean of its elements. Let us now construct a row vector b that...
Problem 2 (explain each codes please) If more information if needed please let me know 1)...
Problem 2 (explain each codes please) If more information if needed please let me know 1) % time vector t=linspace(0,1,1000); x = zeros(size(t)); y = zeros(size(t)); Meaning: 3)% loop to find the value of x and y for different values of time for i=1:length(t) x(i) = v*cos(angle_theta)*t(i); y(i) = h+v*sin(angle_theta)*t(i)-(0.5*g*(t(i).^2)); end Meaning: 4)% find the first index where y<=0 i.e the ball hits the ground I = find(y<=0,1); fprintf('The ball hits the ground at distance of %f meters\n',x(I)); Meaning: 5)...
Experiment 4 1. Design Increasing Voltage Chopper Circuit with DC Motor using any software (example: MATLAB)....
Experiment 4 1. Design Increasing Voltage Chopper Circuit with DC Motor using any software (example: MATLAB). 2. Analyse the peformane of the motor.
Using Matlab to solve the problem below Given X=[-2 -1 0 1 2] Y=[1.5 3.2 4.5...
Using Matlab to solve the problem below Given X=[-2 -1 0 1 2] Y=[1.5 3.2 4.5 3.4 2] a). Plot a scatter plot of the data b). Determine the coefficients of the polynomial ?0 + ?1? + ?2?2 which best fits the data c). Plot this function on the same plot as in part ‘a’. USE MATLAB CODE ONLY! USE MATLAB CODE ONLY! THANK YOU
Please show all work for the problem. Explain your steps and why you did it so...
Please show all work for the problem. Explain your steps and why you did it so i can understand how you got the answer please.Any calculation that cannot be done mentally must be written down, no matter how trivial the calculation might be. Let v=〈10, 11, −2〉and u=〈0, 3, 4〉. Compute: The cosine of the angle between v and u also the vector projvu
Problem 1 Consider the discrete-time LTI system characterized by the following difference equation with input and...
Problem 1 Consider the discrete-time LTI system characterized by the following difference equation with input and initial conditions specified: y[n] - 2 y[n-1] – 3 y[n-2] = x[n] , with y[0] = -1 and y[1] = 0, x[n] = (-1/2)n u[n-2]. ? Write a MATLAB program to simulate this difference equation. You may try the commands ‘filter’ or ‘filtic’ or create a loop to compute the values recursively. ? Printout and plot the values of the input signal, x[n] and...
Please explain me this problem without using Excel please. Thank you. df ss ms f significance...
Please explain me this problem without using Excel please. Thank you. df ss ms f significance f regression 1 552.0 552.0 69.0 0.0000 residual(error) 10 80.0 8.0 total 11 632.0 Coefficients Standard Error t Stat P-Value Intercept 4.3939 1.7569 2.5009 0.0314 X 1.9650 0.2387 8.2315 0.0000 Answer the following questions based on the above information and use a 95% confidence. a. Is the regression model significant at 95% confidence? Why or why not. Fully explain. b. Is X significant? Why...
Problem 7.46 Write electron configurations for the following ions. Part A Ru3+ Express your answer in...
Problem 7.46 Write electron configurations for the following ions. Part A Ru3+ Express your answer in condensed form in order of increasing orbital energy as a string without blank space between orbitals. For example, [He]2s22p2 should be entered as [He]2s^22p^2. SubmitMy AnswersGive Up Incorrect; Try Again Part B As3? Express your answer in condensed form in order of increasing orbital energy as a string without blank space between orbitals. For example, [He]2s22p2 should be entered as [He]2s^22p^2. SubmitMy AnswersGive Up...
Solve the following problem using the MATLAB environment Write a function [approx_root, num_its] = bisection(f,a,b,tol) that...
Solve the following problem using the MATLAB environment Write a function [approx_root, num_its] = bisection(f,a,b,tol) that implements the bisection method. You function should take as input 4 arguments with the last argument being optional, i.e, if the user does not provide the accuracy tol use a default of 1.0e-6 (use varargin to attain this). Your function should output the approximate root, approx_root and the number of iterations it took to attain the root, num_its. However, if the user calls the...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT