How do I make a function work with vectors?
Mostrar comentarios más antiguos
I have this function
function tanH = TAN(x)
tanH(x)=((exp(x))-(exp(-x)))/((exp(x))+(exp(-x)))
end
and I need to change it so that I can get answers if x would be a vector. I've tried putting dots but can't get it to work. What should i be doing?
Thanks in advance.
Respuesta aceptada
Más respuestas (1)
Torsten
el 3 de Abr. de 2020
0 votos
tanH = (exp(x)-exp(-x))./(exp(x)+exp(-x))
Categorías
Más información sobre Linear Algebra en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!