How to graph separate functions from a loop and find their max's?
조회 수: 1 (최근 30일)
이전 댓글 표시
so i have a function that i need to change one variable a few different times.
I used a for loop and got a few different function outputs, which is what i want.
But i need to plot each one of those functions and find the absolute max on each one as well. I know it will be loops within loops i am just not sure how to call up each individual funtion to graph and then evaluate.
syms t
ymax = 0;
dt = .5;
for w = 4:dt:7
x = (4/(-w^2+36))*cos(6*t) + (2/3)*sin(6*t) - (4/(-w^2+36))*cos(w*t)
end
these are the functions i get in the command window
x =
cos(6*t)/5 - cos(4*t)/5 + (2*sin(6*t))/3
x =
(16*cos(6*t))/63 - (16*cos((9*t)/2))/63 + (2*sin(6*t))/3
x =
(4*cos(6*t))/11 - (4*cos(5*t))/11 + (2*sin(6*t))/3
x =
(16*cos(6*t))/23 - (16*cos((11*t)/2))/23 + (2*sin(6*t))/3
x =
NaN
x =
(16*cos((13*t)/2))/25 - (16*cos(6*t))/25 + (2*sin(6*t))/3
x =
(4*cos(7*t))/13 - (4*cos(6*t))/13 + (2*sin(6*t))/3
>>
댓글 수: 0
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!