- matlab 安装 ==省略
- matlab 例子
x = -5:0.1:5
y1 = x.*x-3*x+1
y2 = zeros(size(x))
plot(x,y1,x,y2)
- 求三位数的个十百分位
number = 345
%% 求个位
number1 = rem(number,10)
%% 求十位
number2 = rem(fix(number/10),10)
%% 求百位
number3 = fix(number/100)
- 求素数
x = 1:100
k1 = isprime(x)
k2 = find(k1)
result = x(k2)
![在这里插入图片描述](https://img-blog.csdnimg.cn/20201014160746747.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjkxNzM1Mg==,size_16,color_FFFFFF,t_30#pic_center)
-
- ```matlab
x = sqrt(7)-2i
y = exp(pi/2)
z = (5+cosd(47))/(1+abs(x-y))
- ```
![在这里插入图片描述](https://img-blog.csdnimg.cn/20201014160905512.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_20,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjkxNzM1Mg==,size_16,color_FFFFFF,t_70#pic_center)