Question

1. in Matlab, write a user-defined function, with two input (r,theta) , θ expressed in degrees) and two output arguments (X,Y). The inputs are a location on a polar coordinates corresponding to Cartesian plane expressed in rectangular coordinates. The picture below describes the problem. X, Y rcos θ Some formula that you may need: x = r * cos (theta * pi/180); y r * sin(theta * pi/180); Test your code for r=7, theta=55° and present your results.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

function [x, y] = ConvertToRectangularCoords(r, theta)
x = r * cos(theta * pi/180);
y = r * sin(theta * pi/180);
end

[x y] = ConvertToRectangularCoords(7, 55)

x= 4.0150 y= 5.7341

Add a comment
Know the answer?
Add Answer to:
1. in Matlab, write a user-defined function, with two input (r,theta) , θ expressed in degrees)...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT