I need to find the y values at x=0 for the data provided below

조회 수: 1(최근 30일)
function h = circle(x,y,r)
hold on
th = 0:pi/50:2*pi;
xunit = r * cos(th) + x;
yunit = r * sin(th) + y;
h = plot(xunit, yunit);
title('Circle Diagram')
xlabel('P[MW]'), ylabel('Q[MVAR]')
hold off
  댓글 수: 1
Walter Roberson
Walter Roberson 2021년 2월 16일
Do you mean the y values at xunit == 0 ?
... And if you do, what do you want to do if xunit does not cross zero? Or if it only touches 0 instead of there being two points?

댓글을 달려면 로그인하십시오.


Abhishek Gupta
Abhishek Gupta 2021년 2월 18일
Assuming, from y at x = 0, you mean yunit at xunit = 0, the yunits for the given values of x, y, and r would be as follows: -
theta = [acos(-x/r); (acos(-x/r) + pi)]; % th values at xunit = 0
Yunits = r*sin(theta) + y; % yunit values at xunit = 0


Find more on Creating and Concatenating Matrices in Help Center and File Exchange


Community Treasure Hunt

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

Start Hunting!

Translated by