Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 1: Generate the following matrix without typing in each individual element. Utilize the colon operator, linspace, and other built-in MATLAB functions. Create a vector

image text in transcribedimage text in transcribed

Problem 1: Generate the following matrix without typing in each individual element. Utilize the colon operator, linspace, and other built-in MATLAB functions. Create a vector B by replacing three values 4 4 4 4 15 30 45 60 A 20 22 24 26 |-6 12 24 48] a. in the matrix A with values of your choice. b. Create a vector C by adding a row of your choice to the matrix. C. Pick out the element in the 3rd row and 2nd column in matrix A and save in variable E. Problem 2: Write a script to perform the following operations: a. Using the listdlg or menu command, ask the user what is one item they would like from the store with the following prompt: "What is one item you need in the shopping cart?" Then list the following items as options: TVs, Chairs, Tables, Curtains, Pillows. b. Using the input function, ask the user how many items they would like to purchase with the following prompt: How many items would you like to purchase?" c. Using the fprintf function, print these values in the following format: You have 2 TVs in your shopping cart! Note that your output should look exactly like the sentence above. The wordsumbers in bold are the user input you collect in parts (a) and (b). Problem 3: We have the complex number A = 5+3i. Write a script that a. Finds the real and imaginary parts of A using Matlab built in function Hint: Use Matlab help section (Elementary math) to find the syntax. b. Use fprintf to display the results: The real part is __ and the imaginary part is __. Problem 4: Given the following functions: y= e-1.5* sin( 10x) z=e-1.5x cos(10x) 0 SXS 5 With increment of 0.01 Write a script file to plot y and z as a function of x into two sub regions of the same window using the subplot command. a. Use different line color and styles for the plots b. Include axis labels and a descriptive title for your plot C. In Matlab, turn on the grid d. Use the axis scaling to set the x limits from 0 to 5 and the y limits from -1 to 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions