Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CE 311K-Lab Session 3 March 02, 2020 (Due: March 09) . 1 Plot as MATLAB scripts (20 points): In this exercise, we will use MATLAB

image text in transcribed
CE 311K-Lab Session 3 March 02, 2020 (Due: March 09) . 1 Plot as MATLAB scripts (20 points): In this exercise, we will use MATLAB scripts for easier plotting of graphs and the usefulness of scripts to easily generate plots for different inputs. Create a MATLAB script ques2.m and write commands to execute the following: Use following commands to clear all the existing variables, clear the output screen, and close all existing figure window: o clear all; clc; close all; Define a variable a = 2. Using the command linspace, create a vector x storing 100 values from 0 to 2x in constant increments. Plot the graphs of sin(ax) and cos(ax) on the same graph as a line plot with dash dotted blue and dashed red lines, respectively. Write commands to do the following: o Place a grid for the graph. (hint: grid on command) Put a legend for the graph. Ensure that the font size of the legend is 10. o Label the x axis as 'Input Values'. Ensure the font size of the label is 10. o Label the y axis as 'Value of the function. Ensure the font size of the label is 10. o Put an appropriate title for your graph. Ensure the font size is 10. 1.1) Report the final MATLAB script and the obtained plot. 1.2) Re-run the script after changing the value a to 3. Include the updated plot in the report. 1.3) Change the command that plots a lineplot to a proper command that now plots sin(2x) and cos(2x) in a polar system. Before running the script turn off the commands for label and ylabel using inline comment symbol "%". Include the updated plot in the report

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

Information Modeling And Relational Databases

Authors: Terry Halpin, Tony Morgan

2nd Edition

0123735688, 978-0123735683

More Books

Students also viewed these Databases questions

Question

=+ a. How does this change affect the incentives for working?

Answered: 1 week ago