Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

How do I get this function program to display "v" instead of "ans"?

1 vue (au cours des 30 derniers jours)
Aaron
Aaron le 9 Sep 2013
Clôturé : MATLAB Answer Bot le 20 Août 2021
function v = piecewise_fun(t)
if 0 <= t & t <= 8
v = (10.*t).^2 - (5.*t)
elseif 8 <= t & t <= 16
v = 624 - 5.*t
elseif 16 <= t & t <= 26
v = 36.*t + 12.*(t-16).^2
elseif t > 26
v = 2136*exp(-0.1.*(t-26))
end
end

Réponses (1)

the cyclist
the cyclist le 9 Sep 2013
Put a semicolon at the end of the statement, to suppress the output there. Then, use the disp() function. See
doc disp
for details.

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by