Plotting graph of an equation

Hi, hope that someone can help me on this. I want to plot a graph of this equation:
I have fix value of B,w and d. x-axis will be inner angle and y-axis will be outer angle.
Thank you in advance for any assistance provided.

댓글 수: 5

KSSV
KSSV 2020년 5월 29일
Give the values, you have.....do you have expected output?
Jayden
Jayden 2020년 5월 29일
B will be 19.42, w will be 1100 and d will be 100.
I have tried to plot it using fimplicit but it didn't work out. After running the code, the figure is blank.
Here is my code:
clear all
close all
f = @(i,o)1100/100+((1100/100-2*sind(19.42)).^2-(cosd(19.42-o)-cosd(19.42+i)).^2).^1/2-sind(19.42+i)+sind(19.42-o);
fimplicit(f,[0 50 0 50])
grid on
hold on
Jayden
Jayden 2020년 5월 29일
I just realised that the RHS of the equation should be w/d - .... (not +)! Sorry for the mistake.
darova
darova 2020년 5월 29일
You can try meshgrid and contour
There is a missing pair of parentheses (corrected here):
f = @(ii,o)1100/100+sqrt((1100/100-2*sind(19.42)).^2-(cosd(19.42-o)-cosd(19.42+ii)).^2)-(sind(19.42+ii)+sind(19.42-o));
however if you plot the function, it never equals 0 in the desired range (or anywhere else):
[X,Y] = ndgrid(-500:10:500);
figure
surf(X,Y,f(X,Y))
so fimplicit will fail.

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

답변 (1개)

Vaibhav Tomar
Vaibhav Tomar 2020년 5월 31일

0 개 추천

The function won't become equal to zero in your case. meshgrid might work and generate the required results.

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

질문:

2020년 5월 29일

답변:

2020년 5월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by