Hello, I am trying to plot the following equation to obtain a graph: v(t)=5sin(ω*t+90degrees). I know values have to be in radians in order for MATLAB to compute it. any suggestions on how to write this codes of functions? can i use symbols such as ω and the variable t?

댓글 수: 2

Lawrence
Lawrence 2024년 1월 6일
이동: Dyuman Joshi 2024년 1월 6일
What would be problem in this program?
For angle x1= (5*pi/12 - 0.255) radians
let u=20 t= 0:0.1:9
equation for x axis x=u*cosx1*t
equation for y axis y= u*sinx1*t-0.5*9.81*t.*t
now plotting in matlab as follows:
plot(x,y)
Image Analyst
Image Analyst 2024년 1월 6일
이동: Dyuman Joshi 2024년 1월 6일
Well it's not MATLAB code for one thing.

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

 채택된 답변

Image Analyst
Image Analyst 2015년 2월 23일

0 개 추천

You can specify omega and t then calculate v:
t = linspace(0, 5, 400); % 400 elements from 0 to 5
omega = 4; % Whatever. Units of degrees per second.
v = 5 * sind(omega * t + 90); % Sind() takes values in degrees instead of radians.

댓글 수: 3

David Perez Ramos
David Perez Ramos 2015년 2월 23일
thanks. It works perfect for me. Now what if I would like to graph this function in time domain instead of radians or degrees. any specific command for Time domain?
It is plotted in the time domain. Time is the x axis.
plot(t, v, 'b-', 'LineWidth', 2);
grid on;
David Perez Ramos
David Perez Ramos 2015년 2월 23일
Thanks. That question was not necessary from me lol.You were Very helpful in this topic. thank you

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

질문:

2015년 2월 23일

이동:

2024년 1월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by