How do I correctly write the following function ?

4 次查看(过去 30 天)
I got to this, but I get an error :
f=2.*x.*sin(6.*pi.*x+exp(2.*x.*cos(6.*pi.*x.)));

回答(2 个)

Ameer Hamza
Ameer Hamza 2020-10-7
编辑:Ameer Hamza 2020-10-7
f=2.*x.*sin(6.*pi.*x+exp(2.*x.*cos(6.*pi.*x.)));
%^ remove this dot
Correct is
f=2.*x.*sin(6.*pi.*x+exp(2.*x.*cos(6.*pi.*x)));

VBBV
VBBV 2025-2-22
@Iurie Obodeanov, Close the parenthesis for first term i.e. sin term , and remove the dot at the end of 2nd term as below
syms x
%vv close vv remove dot
f(x)=2.*x.*sin(6.*pi.*x)+exp(2.*x.*cos(6.*pi.*x))
f(x) = 

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by