Hello, I'm new to matlab and I don't know why my plots aren't showing anything
>>clc
>>x=linspace(-2,2,100);
>>f=(3*x)/(9*x.^2+1)
>>g=0.25*(x/((1/16)*x.^2))
>>h=-0.5*(x/(1+(0.25*x.^2)))
>>plot(x,f,'blue')
>>hold on
>>plot(x,g,'red')
>>hold on
>>plot(x,h,'black')
>>hold on
>>grid on

 채택된 답변

Jon
Jon 2020년 11월 18일

1 개 추천

You need to use ./ Other wise you end up with just one value for f,g, and h
x=linspace(-2,2,100);
f=(3*x)./(9*x.^2+1) % ./
g=0.25*(x./((1/16)*x.^2)) % ./
h=-0.5*(x./(1+(0.25*x.^2))) % ./
plot(x,f,'blue')
hold on
plot(x,g,'red')
hold on
plot(x,h,'black')
hold on
grid on

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Labels and Styling에 대해 자세히 알아보기

태그

질문:

2020년 11월 18일

답변:

Jon
2020년 11월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by