How do I correctly write the following function ?

2 visualizzazioni (ultimi 30 giorni)
Iurie Obodeanov
Iurie Obodeanov il 7 Ott 2020
Risposto: VBBV il 22 Feb 2025
I got to this, but I get an error :
f=2.*x.*sin(6.*pi.*x+exp(2.*x.*cos(6.*pi.*x.)));

Risposte (2)

Ameer Hamza
Ameer Hamza il 7 Ott 2020
Modificato: Ameer Hamza il 7 Ott 2020
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 il 22 Feb 2025
@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) = 

Categorie

Scopri di più su Get Started with MATLAB in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by