How do you express this function in MATLAB syntax ?

 Respuesta aceptada

KSSV
KSSV el 9 de Jun. de 2020
Editada: KSSV el 9 de Jun. de 2020
f = exp(x)+sin(5*x) ; % define x before
f = @(x) exp(x)+sin(5*x) ; % call by f(value) This is called Anonymous function

5 comentarios

Can you type how can I write on MATLAB code. Because I wrote this and I had an error.
KSSV
KSSV el 9 de Jun. de 2020
Show us what you tried...and tell us the error.
f = exp(x)+sin(5*x) ;
f = @(x) exp(x)+sin(5*x) ;
like tihs and there is error.
How can I type it. I want this code.
KSSV
KSSV el 9 de Jun. de 2020
I gave comments...did you folllow those comments?
f = exp(x)+sin(5*x) ;
would be an error if you had not defined x before.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Productos

Etiquetas

Preguntada:

el 9 de Jun. de 2020

Comentada:

el 9 de Jun. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by