필터 지우기
필터 지우기

Develop an m-file function to compute v as a function of t. Develop a script to plot v versus t from t=-5 to 50 .

조회 수: 1 (최근 30일)
I am so lost on how to do this...
v(t) is a piecewise function
v(t)=
10t^2 - 5t for 0<=t<=8
624-3t for 8<=t<=16
36t+12(t-16)^2 for 16<=t<=26
2136exp(-0.1*(t-26)) for t>26
0 otherwise

답변 (1개)

Jos (10584)
Jos (10584) 2016년 5월 18일
Create a function m-file like this:
function Value = calculateValue (t)
Value = zeros(size(t)) % default values
tf = t > 0 & t <= 8
Value(tf) = ...
tf = ...
Value(tf) = ...
which you can call from the command line as
T = 1:10
V = CalculateValue(T)

카테고리

Help CenterFile Exchange에서 Adding custom doc에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by