How do I correctly write the following function ?

조회 수: 4 (최근 30일)
Iurie Obodeanov
Iurie Obodeanov 2020년 10월 7일
답변: VBBV 2025년 2월 22일
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