How can i draw the graph of this two functions using matlab

조회 수: 2 (최근 30일)
PULAK Kumer
PULAK Kumer 2020년 12월 19일
댓글: Rafael Hernandez-Walls 2020년 12월 19일
  댓글 수: 1
Rik
Rik 2020년 12월 19일
You can find guidelines for posting homework on this forum here. If you have trouble with Matlab basics you may consider doing the Onramp tutorial (which is provided for free by Mathworks).

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

답변 (1개)

Rafael Hernandez-Walls
Rafael Hernandez-Walls 2020년 12월 19일
when i have this like problem i use this code:
t=linspace(0,2*pi,50);
f=((t>0)&(t<=1)).*2+((t>1)&(t<=pi/2)).*0.5.*t.^2+((t>pi/2)).*cos(t);
plot(t,f)
  댓글 수: 2
Rik
Rik 2020년 12월 19일
Why did you post a complete solution to a homework question?
I would also use ... to make each piece of this function more distinct:
t=linspace(0,2*pi,50);
f= ((t>0)&(t<=1) ).*2+...
((t>1)&(t<=pi/2)).*0.5.*t.^2+...
((t>pi/2) ).*cos(t);
plot(t,f)

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

카테고리

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