Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
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;
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
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started