set. How to do it using matlab?

1 visualización (últimos 30 días)
adriane duarte
adriane duarte el 29 de Oct. de 2020
Respondida: Walter Roberson el 29 de Oct. de 2020
Hello!!
could someone help me build this system in matlab?
how could it be done?

Respuestas (1)

Walter Roberson
Walter Roberson el 29 de Oct. de 2020
logical indexing, if you are processing a vector of x values.
piecewise() if you have the symbolic toolbox and you are building a function or formula
If you need an anonymous function, then consider the form
value1 .* (condition1) + value2 .* (condition2)
such as
2.*(x>3) + -5*(x<=3)
that would implement: "2 if x > 3, -5 if x <= 3"
You do not actually need two conditions if you are creative enough: you have f(x) = -f(-x)

Categorías

Más información sobre Dynamic System Models en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by