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.
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...
I am using matlab and getting a "matrix dimensions error below" for line 22. Can someone...
I am using matlab and getting a "matrix dimensions error below" for line 22. Can someone spot the error and try the code to fix the error. %The beginning step is to generate a functionf(t) that consists of the sum %of the following components % 25 Hz cosine function of magnitude 1 % 50 Hz sine function of magnitude 1 % 40 Hz square wave function of magnitude 1 clear; clc; close all; %sample rate is given at 2500 Hz...
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...
How to perform the chi-square test and get the p-value. Please explain that using a problem...
How to perform the chi-square test and get the p-value. Please explain that using a problem as an example. Thank you!
1. Consider an actual proof problem 2. The problem should estimate one multiple linear regression, or...
1. Consider an actual proof problem 2. The problem should estimate one multiple linear regression, or a logistic regression. Explain the estimation. 3. Consider a different model from step 2. You can try adding other random variables to explain your model, or consider different ways to explain (For example: probit model, lasso, trees, random forest, gradient boosting, or neural net). Then, compare the estimation results of the original model and the new model. ps. If you answer the question with...