how to plot graph using fplot command
7 ビュー (過去 30 日間)
古いコメントを表示
syms x
y=exp(x)
fplot(y)
I got the following errpor. If I replace exp(x) by sin(x) then the code shows graph in the default range
3 件のコメント
Dyuman Joshi
2023 年 12 月 3 日
編集済み: Dyuman Joshi
2023 年 12 月 3 日
How is it not working?
If you get an error, share the full error mesage i.e all of the red text.
if something else, then specify in detail.
回答 (2 件)
Sulaymon Eshkabilov
2023 年 12 月 3 日
Alt syntax for using fplot is this one:
FUN = @(x)exp(x);
fplot(FUN), grid on
figure
% Or a bit better controlled way by specifying the range of x values
fplot(FUN, [-2, 2])
grid on
Sulaymon Eshkabilov
2023 年 12 月 3 日
It is likely that you have saved one of your MATLAB files by fplot.m name or you have named/stored one of your variables by fplot.
(1) Run this command:
>> which fplot % See whether it is a MATLAB builtin function or variable or you saved M-file
If it is one of your saved M-files, just rename your M-file, e.g.: fplot_1.m
(2) Run this command:
>> clear all
(3) Now, you should be able to execute fplot() fcn.
All the best.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!