how do I plot this anonymous function?

34 ビュー (過去 30 日間)
Andrew Serra
Andrew Serra 2016 年 4 月 26 日
コメント済み: yaswanth gaddipati 2020 年 10 月 21 日
Hi i can't seem to figure this problem out and i thought i should ask someone.
When i make the anonymous function: MyFunct = @x 3*x^2 - 2*x + 5
I don't exaclty know how to approach this problem when it comes to plotting it. I'm trying to set the x-range to [-6:1:6] and I'm trying to call my anonymous function(MyFunct) into the y-value for the plot. how would i go about writing these lines code to plot this function?
Thanks

回答 (1 件)

Torsten
Torsten 2016 年 4 月 26 日
f=@(x)3*x.^2 - 2*x + 5;
fplot(f,[-1 1]);
Best wishes
Torsten.
  1 件のコメント
yaswanth gaddipati
yaswanth gaddipati 2020 年 10 月 21 日
Thanks Torsten!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by