0
点赞
收藏
分享

微信扫一扫

matlab画071(只是为了玩)

figure;
% 画0
t=linspace(0,2pi,1000);
x=30+10cos(t);
y=33+21sin(t);
x1=30+6cos(t);
y1=33+15sin(t);
plot(x,y,‘r-’,x1,y1,‘r-’)
axis equal
hold on
%画7
A=[50,50,67,55.2,61.12,74,50];
B=[54,50,50,12, 12, 54,54];
plot(A,B,‘r-’)
hold on;
%画1
r=10.5948;
x1=83.5;y1=46.9052;
x3=93.5;y3=54;
x2=83.5;y2=57.5;
m_tan=(y3-y2)/(x3-x2);
that=atan(m_tan);
theta=-pi/2:pi/1000:that;
x=rcos(theta)+x2;
y=rsin(theta)+y2;
plot(x,y,‘r-’)
axis equal
hold on
x1=83.5;y1=46.9052;
x3=93.5;y3=54;
C=[83.5 83.5 90.5 90.5 96.5 96.5 93.5 ];
D=[46.9052 45 45 12 12 54 54];
plot(C,D,‘r-’)
hold on
for i=1:length©
hold on
T=num2str(i);
text(C(i)+0.1,D(i)+0.1,T)
hold on
end
axis([0 120 0 60]);
set(gca,‘fontsize’,36)
title(‘071’)
xlabel(‘x轴’)
ylabel(‘y轴’)


效果:

matlab画071(只是为了玩)_json


收获:
1.了解了画圆形的几种方法
1.1
rectangle(‘Position’,[4,3,2,2],‘Curvature’,[1,1]),
axis equal

matlab画071(只是为了玩)_数据_02


1.2直接找出数据,再简单输出画线
2.画椭圆

3了解了一些颜色的RGB形式

clear;clc
syms x y
a=5;b=21;
h=ezplot((x-20)2/a2+(y-35)2/b2==1)
delete (get(gca,‘title’))
set(h,‘color’,[1 ,0,0],‘LineWidth’,2);
t=linspace(0,2pi,1000);
x=20+10cos(t);
y=35+21sin(t);
plot(x,y,‘r-’)
axis equal
hold on

例如这个:

​​ https://www.sojson.com/rgb.html​​

举报

相关推荐

0 条评论