Question: Code Block # 1 Write two Matlab components: a script and a function that together do the following: ( a ) The script assigns a
Code Block # Write two Matlab components: a script and a function that together do the
following:
a The script assigns a value of radians to a variable named alpha
b The script calls the function, passing the angle alpha as an input. The function calculates the
elements of a DCM that represents a simple rotation through that angle about the axis.
The output of the function is the DCM
c The script displays the DCM this does not need to be specially formatted
Required:
a You must write both the script and the function in Matlab. DO NOT use any DCM library
function such as angledcm
b Your function must use the form
function outputs myfunction inputs
c Note: you can append the function to the end of the script, or preferred put the function in
a separate m file with the same name as the function this lets you build a library of functions
that other scripts can call useful for later assignments and other courses!
d Submit a screenshot of your code and a screenshot of the output.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
