Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Please help me write the f function in matlab
2 ビュー (過去 30 日間)
古いコメントを表示

2 件のコメント
Ameer Hamza
2020 年 10 月 7 日
What have you already tried? https://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer
回答 (2 件)
KSSV
2020 年 10 月 7 日
- Read about sin, cos
- Read about exp.
- Read about linspace.
Example: If I want to write a function for sin(pi*x)
m = 100 ;
x = linspace(0,2,m) ;
y = sin(pi*x) ;
plot(x,y)
2 件のコメント
KSSV
2020 年 10 月 7 日
Show us the whole code which you tried....so that we cna help you.
m = 100 ; % give your value
x = linspace(0,1,m) ; % give your range for x
f=2*x.*sin(6*pi*x+exp(2*x.*cos(6.*pi*x)));
plot(x,f)
In your line..you have used x. this is not correct. You need not to use pi.*..as pi is only a single number.
James Tursa
2020 年 10 月 7 日
編集済み: James Tursa
2020 年 10 月 7 日
I would assume from the equation image that the exp( ) stuff maybe should be outside of the sin( ) stuff. E.g.,
f = 2.*x.*sin(6.*pi.*x) + exp(2.*x.*cos(6.*pi.*x));
0 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!