Two output function issue

8 Ansichten (letzte 30 Tage)
Patirick Legare
Patirick Legare am 8 Feb. 2019
Kommentiert: Stephen23 am 8 Feb. 2019
This function is supposed to display the radius and the angle when you input the coordinates and it's only displaying the radius can someone help me out ?
Thanks in advance
function[r,d]=Cartapol(x,y)
r=sqrt((x^2)+(y^2));
d=atand(y/x);
if(x<0)
d=180+d;
elseif (x>0 && y<0)
d=360+d;
elseif x==0 && y==0
d=0;
elseif x==0 && y<0
d=270;
end
  4 Kommentare
Patirick Legare
Patirick Legare am 8 Feb. 2019
Hi David ,
Thank you for that shortcut I will definetly be using this.Turns out that the fuction did work just fine I was not calling it properly... I am very new to this so it's a process.
Thanks for you help I really appreciate it !
Stephen23
Stephen23 am 8 Feb. 2019
@Patirick Legare: basic MATLAB concepts, such as how to call functions with multiple outputs, are explained in the introductory tutorials:
Highly recommended.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Operators and Elementary Operations finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by