I need help with MATLAB homework Please help me with showing
I need help with (MATLAB) homework
Please help me with showing the steps
step by step please
1. degrees to radians This function will take in a number in degrees and turn that number into a value in radians. Remember 180 degrees is the same as pi in radians. Here is an example of the first line of the function design pattern for the degrees to radians function: function rs degrees to radiansC ds While you cannot change the name of the function you are encouraged to use better names for the parameters and output variables. Notice as you read on that the turtle function deals with degrees (people friendly) but the rotate vector functions deal with radians (computer friendly) 2. plus This function will take in either two vectors or a point and a vector and return either a new vector that is the sum of the two vectors, or a new point, which is the sum of the vector and the point. Remember, to sum two vectors, or to add a point to a vector, you simply add the x fields together and the y fields together. Because points and vectors use the same data structure (all the fields have exactly the same names, this function will also be able to take a point and a vector (with no additional code) and add the vector to the point. Note: Once the plus function is working you can call it either as a regular function or use the operator! my 2nd pt plus C my_pt, my vector or by the more elegant operator notation: my 2nd pt my pt my vectorSolution
1.
degree_to_radians.m
function [ rs ] = degree_to_radians( ds )
rs=pi*ds/180;
end
Output:-
>> degree_to_radians(180)
ans = 3.1416
>> degree_to_radians(360)
ans = 6.2832
2.
plus.m
function [ my_2nd_pt ] = plus( my_pt, my_vector )
my_2nd_pt = my_pt+my_vector;
end
Output:-
>> plus([1],[1 2 3 4])
ans = 2 3 4 5
>> plus([1 1 2 3],[1 2 3 4])
ans = 2 3 5 7
