필터 지우기
필터 지우기

How would I go about plotting an equation?

조회 수: 1 (최근 30일)
Raul
Raul 2012년 3월 15일
I need to plot the following equation: (y/34) + (x/84) = 1; with 'y' and 'x' being numbers from 0-100. I know how to define x and y(i.e. x = (0:100) and likewise with 'y'), but when I try plotting the equation I just get a blank graph, can anyone guide me in the right direction, please?

답변 (2개)

Geoff
Geoff 2012년 3월 16일
You are incorrect in your assumption that you define 'y' in the same manner as 'x'. To 'plot the equation' you first have to rearrange for y in terms of x, then plug your vector for x into that, and finally plot.
x = 0:100;
y = % you work it out
plot(x,y);

Rick Rosson
Rick Rosson 2012년 3월 15일
Please post your code.

카테고리

Help CenterFile Exchange에서 Graphics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by