Hey Guys, I am currently learning how to use Matlab and I have a problem that I am struggling with. I am struggling to graph the function y = sin^2(t) on the interval t ∈ [0,2π]. Can you please help me this?

댓글 수: 5

Dyuman Joshi
Dyuman Joshi 2024년 2월 29일
편집: Dyuman Joshi 2024년 2월 29일
Please share the code you have written yet and state the issue you are facing.
Voss
Voss 2024년 2월 29일
The syntax for y = sin^2(t) in MATLAB is
y = sin(t).^2
Hope that helps.
Sam Chak
Sam Chak 2024년 2월 29일
First things first, make sure to bookmark the Help Center, and then search for the keyword 'plot'. You will find the relevant information at this URL: https://www.mathworks.com/help/matlab/ref/plot.html.
It's always a good idea to start by searching in the Help Center before seeking technical assistance, unless the problem is highly specific and no relevant examples can be found.
Dakalo
Dakalo 2024년 2월 29일
@Sam Chak Okay thank you. I will make use of it.
Les Beckham
Les Beckham 2024년 2월 29일
If you are just getting started with Matlab, I would highly recommend that you take a couple of hours to go through the free online tutorial: Matlab Onramp

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

 채택된 답변

Alexander
Alexander 2024년 2월 29일

0 개 추천

t = linspace(0,2*pi,1000);
y = sin(t).^2;
plot(t,y);

댓글 수: 5

Dyuman Joshi
Dyuman Joshi 2024년 2월 29일
편집: Dyuman Joshi 2024년 2월 29일
Please don't do obvious homework questions on Answers, when no effort has been shown. This does not help the student, who learns nothing more than to post all of their homework problems on the site, hoping they will find someone willing to do their thinking and work for them. Worse that that, it convinces the next student who comes along to do the same.
If you want to help, then find a way to push the student in the right direction. But posting a complete solution does far more harm than good.
Alexander
Alexander 2024년 2월 29일
To be honest, some of these questions remind me at the time when I got my first PC-Matlab license in the late 80s. But there was no one I can ask, no www and no mailing list. Hence, it took a long time until I got familiar with Matlab, comming from F77. So I'm not as strict with novices and I'm indulge them.
Dakalo
Dakalo 2024년 2월 29일
Thank you, @Alexander. @Dyuman Joshi You're right, I was frustrated because I was trying to figure it out for a long time without reaching any solution. Next time I will make it a point to try reach some form of a solution.
Alexander
Alexander 2024년 2월 29일
Cheers
@Dakalo, Can you enter the code (click this icon ) and run it here (click this icon )?
A grey field will appear so that you can type out the plotting code. You should also learn about labeling and display trick for repeating decimals such as .

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Graphics Performance에 대해 자세히 알아보기

제품

태그

질문:

2024년 2월 29일

댓글:

2024년 2월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by