Question: X = [ 2 , 2 , 0 , - 3 , 0 ] ; Y = [ 0 . 5 , 1 . 1
X ;
Y ;
r zerossizeX;
theta zerossizeX;
lenX lengthX;
AngFact pi;
for i :lenX
if Xi && Yi
ri sqrtXi Yi;
thetai atanYi Xi;
thetai AngFact thetai;
elseif Xi && Yi
ri sqrtXi Yi;
thetai atanYi Xi pi;
thetai AngFact thetai;
elseif Xi && Yi
ri sqrtXi Yi;
thetai atanYi Xi pi;
thetai AngFact thetai;
elseif Xi && Yi
ri sqrtXi Yi;
thetai pi;
thetai AngFact thetai;
elseif Xi && Yi
ri sqrtXi Yi;
thetai pi;
thetai AngFact thetai;
elseif Xi && Yi
ri sqrtXi Yi;
thetaipi;
thetai AngFact thetai;
else
ri;
thetai;
end
end
Print the Outputs.
dispThe xcoordinate values:;
dispX;
fprintf
The ycoordinate values:;
dispY;
fprintf
The rcoordinate values:;
dispr;
fprintf
The theta in degrees values:;
disptheta;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
