cart to cyl (getting error of Not enough input arguments.)

1 vue (au cours des 30 derniers jours)
Sai Hitesh Gorantla
Sai Hitesh Gorantla le 29 Jan 2020
function [Pcyl] = cart2cyl(Pcart)
% input and output as 3 by 1 vectors
y = Pcart(2);
z= Pcart(3);
rho= sqrt(x^2+y^2);
if x,y >= 0
phi = atan(y/x);
elseif x,y < 0
phi = atan(y/x)+pi;
elseif (x>0) && (y<0)
phi = 2*pi-atan(y/x);
phi = pi-atan(y/x);
Pcyl= [rho phi z]';

Réponse acceptée

KSSV le 29 Jan 2020
Dont run the function using run/ green button. You define the values of inputs in the workspace and then call the function.
Pcart = rand(1,3) ;
Pcyl = cart2cyl(Pcart)

Plus de réponses (0)


Community Treasure Hunt

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

Start Hunting!

Translated by