How do I make a function work with vectors?
古いコメントを表示
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.
採用された回答
その他の回答 (1 件)
Torsten
2020 年 4 月 3 日
0 投票
tanH = (exp(x)-exp(-x))./(exp(x)+exp(-x))
カテゴリ
ヘルプ センター および File Exchange で Linear Algebra についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!