필터 지우기
필터 지우기

Plotting a graph of y for a given value of x

조회 수: 1 (최근 30일)
henry tochukwu
henry tochukwu 2022년 7월 27일
편집: dpb 2022년 7월 27일
Please I've been trying to plot the graph above but I'm finding it difficult.. please can someone help
  댓글 수: 1
dpb
dpb 2022년 7월 27일
Let's see your work to date and a specific Q? where you got stuck...

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

답변 (2개)

henry tochukwu
henry tochukwu 2022년 7월 27일
편집: dpb 2022년 7월 27일
x= [1 2 3 4 5 6 7 8 9 10];
x= [-5:20:5];
y= [(5 * sin(x))/ (x + exp(-0.75x))]-(3*x)/5
plot(x,y)
This is the one I did before
  댓글 수: 3
henry tochukwu
henry tochukwu 2022년 7월 27일
I'm not good at this sir... Just learning the basics.
dpb
dpb 2022년 7월 27일
Well, you only getter better by working at it -- just being handed solutions doesn't help the learning process nearly as much -- and learning to use the documentation is part of learning as well as is the precept that homework should be the student's effort.
We'll prompt and coach and answer specific Q?, but handing out complete homework solutions isn't the purpose of the forum and is rarely done -- at least until there's been significant effort shown to solve the problem.

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


henry tochukwu
henry tochukwu 2022년 7월 27일

x = [-5:1:10]; y = (5 * sin(x))/ (x + exp(-0.75*x))-(3*x)/5; plot(x,y,'.-'), xlabel('x-axis'), ylabel('y-axis'), grid on, axis equal

  댓글 수: 1
dpb
dpb 2022년 7월 27일
편집: dpb 2022년 7월 27일
You didn't heed the instruction about "dot" operators -- mrdivide, / is NOT at all the same thing.
For a nicer-appearing plot (when you finally get the right values), you'll want more x values than what default colon spacing gives -- look at linspace for one alternative, or if it isn't precluded by the not-shown instructions on the homework assignment page, ezplot
Oh, and please format the code with the code button so it's readable/executable...

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

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by