Please write a simple Matlab program for these functions. I have already done a
ID: 646009 • Letter: P
Question
Please write a simple Matlab program for these functions. I have already done a few however I am kinda lost these last three.
So for converting degrees to radians is would be something like this I think
funciont D_to_F
degrees=input('Enter radians')
degrees*pi/180
Is this correct? Or how would you do it?
_____________________________________________________
1.Convert degrees to radians
2.Calculate the area of a circle
3.Calculate the area of a triangle
4. Calculate the tan and cot of a value in radians (in one function)
Explanation / Answer
Answers:
a)Function to convert Degrees to Radians:
Source Code
function r = d2r(d)
%A simple conversion function
%Degrees to Radians
%Syntax: {angle in radians}=d2r({angle in degrees})
r=d/180*pi;
b) Function to Calculate the area of a circle:
function areacircle
% interactive program to compute area of circle
r = input(