Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a simple MATLAB function to: 1.Calculate the sin and cos of a value in rad

ID: 646122 • Letter: W

Question

Write a simple MATLAB function to:

1.Calculate the sin and cos of a value in radians (in one function)

2. Calculate the tan and cot of a value in radians (in one function)

For number one I did something like this but I am not sure that its correct. Can someone help me do number 1 and 2? Thank you.

function cos_sin_in_Degrees

% This program displays cos and sin in radians when user enters degrees

%matlab normally displays answers in radians

R=input('enter degrees:');

R*(pi/180);

Sin=sin(R)

Cos=cos(R)

end

__________________________________________

Explanation / Answer


function cos_sin_in_Degrees
prompt = 'Enter degress ';
R = input(prompt)
R*(pi/180);
Sin=sin(R)
Cos=cos(R)
end

function tan_cot_in_Degrees
prompt = 'Enter degress ';
R = input(prompt)
R*(pi/180);
Tan=tan(R)
Cot=cot(R)
end

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote