Question

Can you explain how this works?

(cl) The following Matlab code is executed. What is Matlabs output? x - [0 1 2*ones(1, 4)]; b -2:3]. 2; y -x.*b; disp(y); Solution: 010 28 18

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
Can you explain how this works? (cl) The following Matlab code is executed. What is Matlab's...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • matlap Question 1 1. Consider the following Matlab program 5 - (2 < 3) & (C2...

    matlap Question 1 1. Consider the following Matlab program 5 - (2 < 3) & (C2 > 3) 1 (1 - 0)) What is the final value of s? A. True B. *1 CO D. false 2- Which expression tests whether variable x is between (but not the same as) the values 5 and 10 (a) 5 <x< 10 (b) 5 <= x <= 10 (c) 5 < X & X > 10 (d) x < 10 & 5 <...

  • 1. (20pts) Write the MATLAB program to find the multiplication of [B][A] MATLAB's matrix operation capabilities.....

    1. (20pts) Write the MATLAB program to find the multiplication of [B][A] MATLAB's matrix operation capabilities.. .you must code the individual steps. [4 51 =. Do not use 3 71 4 1 2,and [B] = 1 2 6 [A] = 0 4 15 2 6. 1. (20pts) Write the MATLAB program to find the multiplication of [B][A] MATLAB's matrix operation capabilities.. .you must code the individual steps. [4 51 =. Do not use 3 71 4 1 2,and [B] =...

  • 2. What is the value of x alter the following code is executed # include<iostream> using...

    2. What is the value of x alter the following code is executed # include<iostream> using namespace std; int main int t-0, c- 0,x-3; while (c < 4) t=t+x; cout << x return 0; a) 3 b) 21 c) 24 d) 48 3. What is the output of the following code? # include<iostream> using namespace std; int main0 int a- 3; for (int i 5; i >0; i) a a+i cout << a << “ “ return 0; d) 8...

  • 1. Write a Matlab function to convolve two sequences objects: function y = conv(x, h) %...

    1. Write a Matlab function to convolve two sequences objects: function y = conv(x, h) % CONV Convolve two finite-length Matlab sequence objects, x and h % returning sequence object, y. When you convolve x[n] and h[n] , you may not use MATLAB's numerical conv routine. 2. write a second convolution function, conv_rt, in Matlab that basically implements a real-time convolu- tion strategy: function y = conv_rt(x, h) % Convolve two finite-length arrays, x and h % returning array, y...

  • MATLAB scripts are how multiple lines of code can be executed vs. entering in a line...

    MATLAB scripts are how multiple lines of code can be executed vs. entering in a line of code one at a time through the command window. Write a script that does the following. Only display to the console window what is specified. Creates a 4 x 10 matrix with the 1strow being 1 to 10, the 2ndrow being 11 to 20, the 3rdrow being 21 to 30, and the last row being 31 to 40. The matrix is shown on...

  • help me please , By using MATLAB How can I plot the solution of linear diffrential...

    help me please , By using MATLAB How can I plot the solution of linear diffrential system ? I want the code in general case We were unable to transcribe this imageclose all clear MATLAB Code: clc A= [1 0 1; 0 0 0;00-1]; % Coefficient Matrix Xo = [5 76]'; % Initial condition V, D = eig(A); % Get the Eigen values and Eigen vectors % General Solution: X=Sum of {c_i*exp(L_i*t) *V_i % where c_i are constants, L_i are...

  • MATLAB question I need the code exactly as you would write it in MATLAB. thank you...

    MATLAB question I need the code exactly as you would write it in MATLAB. thank you 1. Consider a Gaussian solution of the traveling-wave form ψ(z,t)-exp(-a(z-vt)2). The parameter values are a 1, 2. (a) Explain the physical meaning of these parameters (eg. what would happen if we took a = 10 instead?) Determine the direction of propagation of this solution: Is it traweling to the left or to the right? (2pts) (b) Write a Matlab code to plot the Gaussian...

  • Use the attached Matlab code as a basis to solve the following ordinary differential equation usi...

    Question 1 QUESTION 2 Use the attached Matlab code as a basis to solve the following ordinary differential equation using Euler's method, with timestep of 0.1, from t-0to t-100. d)0) -0 - sin (5vt cos(у Plot y versus t from t=0 to t=100. How many local maxima are on this interval(do not include end points). Be careful to count them all! Answer should be an integer 1 w% Matlab code for the solution of Module 2 3 dt-9.1; %dt is...

  • Need Help on Matlab matrix system. Have your code return the solution x and show this...

    Need Help on Matlab matrix system. Have your code return the solution x and show this solution in a command prompt printout. Note that you can, of course, check your answer easily with the Matlab backslash command, A\b. Naive LU Decomposition Now, starting with your functioning Gauss Elimination code, modify it to keep the factors in the same matrix that it is passed. You of course will not modify the b-vector. Have this code return the L and U matrices...

  • Question 1: 1. Figure out what the following MATLAB code does (Notice that R n =...

    Question 1: 1. Figure out what the following MATLAB code does (Notice that R n = 500 for jay - 1:4 ifjoy > 1;oldtime = time; end M rand(n); t cputime; forrep -1:5 R chol(A): en time = cputime-t; if jay > 1; ratio - time/oldtime, end en If you put these instructions into a file named, say, zap.m, you can run the program by typing zap from the MATLAB command line. The functions randn, cputime, and chol are built-in...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT