我如果想把一个正弦函数离散化的图像画出来应该怎么样呢?
偶也是刚学MATLAB的,这个还是比较简单实现吧,直接用plot函数就可以,
MATLAB代码:
x=-pi:0.1:pi;
y=sin(x);
plot(x,y,'+')
这个图像就是用离散的'+'表示,当然也可以用其他的颜色或者符号表示.
b blue . point - solid
g green o circle : dotted
r red x x-mark -. dashdot
c cyan + plus -- dashed
m magenta * star (none) no line
y yellow s square
k black d diamond
v triangle (down)
^ triangle (up)
< triangle (left)
> triangle (right)
p pentagram
h hexagram
vBulletin® v3.8.3,版权所有 ©2000-2025,Jelsoft Enterprises Ltd.