필터 지우기
필터 지우기

wrong function plot different than wolframalpha

조회 수: 2 (최근 30일)
MAJED
MAJED 2014년 6월 23일
댓글: MAJED 2014년 6월 23일
I wrote this code to plot a function
y=-1:0.05:15;
yprim= (0.75*y)-(0.05*y.^2)-((1.5*y.^3)/(1.25+y.^3));
plot(y,yprim)
hold on
grid on
xlabel('y');
ylabel('dy/dt');
title('plot of function(1) with b=0.05');
it keep giving me the wrong plot can i have some help
  댓글 수: 1
dpb
dpb 2014년 6월 23일
Well, what do you think is wrong? It pretty much is what you coded; now perhaps that isn't what you really intended but we can't tell that with nothing else to go on...

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

채택된 답변

the cyclist
the cyclist 2014년 6월 23일
I'm guessing you meant
yprim= (0.75*y)-(0.05*y.^2)-((1.5*y.^3)./(1.25+y.^3));
Notice the ./ where you just had /
  댓글 수: 2
dpb
dpb 2014년 6월 23일
Good catch--I thought I had looked for that but missed it not being there...
MAJED
MAJED 2014년 6월 23일
Oh... yes, thanks your right, it worked

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by