How do I correctly write the following function ?

I got to this, but I get an error :
f=2.*x.*sin(6.*pi.*x+exp(2.*x.*cos(6.*pi.*x.)));

Answers (2)

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)));
@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) = 

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Tags

Asked:

on 7 Oct 2020

Answered:

on 22 Feb 2025

Community Treasure Hunt

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

Start Hunting!