Function to evaluate arguments using pol2cart
조회 수: 3 (최근 30일)
이전 댓글 표시
Write a function with input arguments to be the magnitude and angle (in degrees) of a complex number and output argument to be the Cartesian form of the same number, i.e. x+yi.
댓글 수: 0
답변 (2개)
Roger Stafford
2014년 3월 29일
Think about how the real and imaginary parts of any complex number are related to its magnitude and angle, and you will have just about solved your problem. The necessary matlab code is easy to write.
Marta Salas
2014년 3월 30일
편집: Marta Salas
2014년 3월 30일
As arguments for your function you have to write the name of the variable:
function x = Carlos_Virguez_Ex14(r,angle)
Note: you have to modify the code inside your function to use these variables.
then when you call that function [in the MATLAB's prompt] you assign the values for those variables:
>>Carlos_Virguez_Ex14(5,63)
댓글 수: 2
참고 항목
카테고리
Help Center 및 File Exchange에서 Trigonometry에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!