How to calculate and plot sin functions?

조회 수: 1 (최근 30일)
Nicolas Sarmiento Sierra
Nicolas Sarmiento Sierra 2015년 4월 7일
댓글: Nicolas Sarmiento Sierra 2015년 4월 7일
Hello I am a Matlab begginer user. I am trying to calculate and plot the function of a damped sine-wave and the dynamic range (envelope). However, I can not find the right set of code to make the problem run.
This is the equation I am working on:
f(t)=80.^((-1/80)*(t))*sin(0.25*(t)+(pi/3))
I have defined t as t = 100 % seconds
Any help will be welcome.
Thank you

답변 (1개)

Stephen23
Stephen23 2015년 4월 7일
편집: Stephen23 2015년 4월 7일
MATLAB works (primarily) with numeric arrays, thus the name "MATrix LABoratory". You need to first create a vector of (numeric) time values, and then perform your operations on it like this:
>> t = 0:0.1:100;
>> s = 80.^(-t/80) .* sin(0.25*t+pi/3);
>> plot(t,s)
These tutorials are highly recommended for all beginners, and introduce many useful aspects of both understanding and using MATLAB:
  댓글 수: 1
Nicolas Sarmiento Sierra
Nicolas Sarmiento Sierra 2015년 4월 7일
Dear Mr Cobeldick.
Thank you for you answer.
I have understood the concept so far. However, I might now be able to plot in via Simulink and obtain a graphic in the next fashion:
I suppose this result can be plot by opening the Simulink library and selecting the proper symbols of the sinwave.
Any further recommendation is welcome.
I have completed your recommended tutorials.
Thank you

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by