用matlab画x*sin(x)的图

来源:学生作业帮助网 编辑:六六作业网 时间:2024/07/17 08:36:46
用matlab画x*sin(x)的图用matlab画x*sin(x)的图用matlab画x*sin(x)的图clearall;clc;y=@(x)x.*sin(x);ezplot(y);gridon;

用matlab画x*sin(x)的图
用matlab画x*sin(x)的图

用matlab画x*sin(x)的图
clear all;clc;
y=@(x)x.*sin(x);
ezplot(y);grid on;
--------------------------
或者用数值方法(建议使用数值方法)
clear all;clc;
x=-2*pi:pi/20:2*pi;
y=x.*sin(x);
plot(x,y);grid on;

syms x

ezplot(x*sin(x))