MATLAB 绘制正弦函数 sin(x) 图形
可以使用 MATLAB 中的 'sin' 函数和 'plot' 函数来绘制 'sin(x)' 的图形。
代码如下:
x = linspace(0, 2*pi, 1000); % 生成 x 轴上的点
y = sin(x); % 计算 y 轴上的值
plot(x, y); % 画出 sin(x) 的图形
xlabel('x'); % 设置 x 轴标签
ylabel('sin(x)'); % 设置 y 轴标签
title('sin(x)'); % 设置图形标题
运行上述代码,就可以得到 'sin(x)' 的图形。
原文地址: https://www.cveoy.top/t/topic/js0K 著作权归作者所有。请勿转载和采集!