Answered step by step
Verified Expert Solution
Question
1 Approved Answer
answer the code % % - - - - - - - - - - - - - - - - - - - -
answer the code
CEE Computing Project Getting to Know MATLAB
Name: TYPE YOUR NAME HERE
Date: Type the date of submittal here
Recitation Section:
clear; clc; Clear the workspace and command window
Part
Set up variables and compute five results
dispPart ; output to command window
VariableCREATE YOUR OWN VARIABLE NAMES
VariableAgain, use your own variable names
continue this section
Create output for the command window
fprintfsi
Addition: Variable
fprintfsi
Division: complete this command and continue
WHAT DOES THE si and n DO IN THE fprintf COMMAND?
WHAT HAPPENS TO THE OUTPUT IF YOU PUT A SEMICOLON AFTER THE CALC?
IS THE COS CALCULATED IN DEGREES OR RADIANS?
HOW CAN YOU GET THE OTHER ONE DEGREES OR RADIANS
Part
Set up matrices and perform five matrix computations
dispPart ; output to command window
MatrixA ; Again, use your own variable names
continue this section
CAREFULLY CONSIDER THE MATRIX ALGEBA THAT HAPPENS HERE.
Part
Use nested for loops to store a series of values in an D array
The user must have input for the number series.
dispPart ; output to command window
startvalue input Enter a real number for the starting value of your series. ;
input complete this command, and the rest in this part
size input Enter a positive integer
value startvalue;
zerossizesize; initialize the size x size matrix
This is where you insert a pair of nested for loops to fill in the
correct values in the matrix.
display the completed matrix to the command window
Part
Use 'linspace' arrays to create plots of the given functions with
specific number of steps.
dispPart ; output to command window
Create an array of x values with a specific number of evenly or
linearly spaced points.
Then use that to calculate an array of corresponding y values and plot
x vs y
Notice one function starts at x but the other function starts at x
Create the arrays and function values here.
xstart ;
steps;
xend ;
x linspacecomplete this command, and the rest of this part.
y
xstart
x linspace
Create the plot
fig figure; clf; grid on; hold on;
xlabelx; ylabely; titlePart Linspace Array Calcs';
p plotx y;
setp 'Color','red', 'LineWidth',;
p plotx y;
setp 'Color','blue', 'LineWidth',;
legendFunction 'Function 'Location', 'northwest';
HOW MANY 'STEPS' WERE TAKEN FOR EACH FUNCTION?
HOW MANY POINTS xy data pairs WERE CREATED FOR EACH FUNCTION?
WHAT WAS THE STEP SIZE FOR EACH FUNCTION?
WHAT HAPPENS WHEN THERE'S NOT ENOUGH POINTS IN THE RANGE?
Part
Use arrays to create plots of the given functions with specific step
sizes.
dispPart ; output to command window
Part is alomst identical to part except you cannot use the linspace
command.
Create an array of x values for the given range and step size.
Then use that to calculate an array of corresponding y values and plot
x vs y
linspace WILL NOT WORK FOR THIS.
Notice one function starts at x but the other function starts at x
Create the arrays and function values here.
xstart ;
stepsize;
xend ;
x
y
xstart
x
Create the plot COMPLETE THESE COMMANDS
fig figure; clf; grid on; hold on;
xlabelx; ylabely; titlePart Step Array Calcs';
p plot
setp 'Color','red', 'LineWidth',;
p plot
setp 'Color','blue', 'LineWidth',;
legendFunction 'Function 'Location', 'northwest';
HOW MANY 'STEPS' WERE TAKEN FOR EACH FUNCTION?
HOW MANY POINTS xy data pairs WERE CREATED FOR EACH FUNCTION?
WHAT WAS THE STEP SIZE FOR EACH FUNCTION?
WHAT HAPPENS WHEN THE STEP SIZE IS TOO LARGE?
CAN YOU ADJUST PART & PART TO GET THE EXACT SAME STEP SIZE AND NUMBER
OF POINTS using the diff
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started