matlab怎么在图上标出具体点坐标?图上的坐标怎么标出?
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/09 06:37:31
matlab怎么在图上标出具体点坐标?图上的坐标怎么标出?
原程序
x=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39];
y2=[0 3.75 10.95 19.95 29.3 38.45 46.85 54.50 61.55 68.00 73.85 78.95 83.75 88.25 92.3 95.9 99.2 102.2 104.9 107.3 109.55 111.65 113.6 115.4 117.05 118.55 119.9 121.1 122.15 123.05 123.8 124.4 124.85 125.25 125.61 125.91 126.11 126.26 126.36 126.44];
plot(x,y2);
hold on;
y3=126.44
plot(x,y3,'-')
原程序
x=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39];
y2=[0 3.75 10.95 19.95 29.3 38.45 46.85 54.50 61.55 68.00 73.85 78.95 83.75 88.25 92.3 95.9 99.2 102.2 104.9 107.3 109.55 111.65 113.6 115.4 117.05 118.55 119.9 121.1 122.15 123.05 123.8 124.4 124.85 125.25 125.61 125.91 126.11 126.26 126.36 126.44];
plot(x,y2);
hold on;
y3=126.44
plot(x,y3,'-')
对巳知坐标的点,可以这样标出:
plot(5,38.45,'rs','MarkerEdgeColor','k','MarkerFaceColor','g','MarkerSize',5)
text(5,38.45,'(5,38.45)','EdgeColor','red','VerticalAlignment','bottom');
plot(38,126.36,'rs','MarkerEdgeColor','k','MarkerFaceColor','g','MarkerSize',5)
text(38,126.36,'(38,126.36)','EdgeColor','red','VerticalAlignment','bottom');
对未知坐标的点,可以先插值,再标出:
以下代码在7.1版以上均可运行.
close all
clear,clc
x=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39];
y2=[0 3.75 10.95 19.95 29.3 38.45 46.85 54.50 61.55 68.00 73.85 78.95 83.75 88.25 92.3 95.9 99.2 102.2 104.9 107.3 109.55 111.65 113.6 115.4 117.05 118.55 119.9 121.1 122.15 123.05 123.8 124.4 124.85 125.25 125.61 125.91 126.11 126.26 126.36 126.44];
plot(x,y2);
hold on;
y3=126.44;
plot(x,y3,'-');
% Set up fittype and options.
ft = 'linearinterp';
opts = fitoptions( ft );
opts.Normalize = 'on';
% Fit model to data.
fitresult = fit( x',y2',ft,opts );
xx1 = [6.321,11.15,21.15]; % x = [6.321,11.15,21.15]
yy1 = fitresult( xx1 ); % 与x对应的y值
% 画点 标注
for i = 1:length(xx1)
plot(xx1(i),yy1(i),'rs','MarkerEdgeColor','k','MarkerFaceColor','g','MarkerSize',6)
text(xx1(i),yy1(i),['(',num2str(xx1(i),'%5.2f'),',',num2str(yy1(i),'%5.2f'),')'],'EdgeColor','red','BackgroundColor',[.7 .9 .7],'VerticalAlignment','bottom');
end
再问: 我要标出y值为49.31,79.66对应的坐标 程序怎么写?
再答: 我要标出y值为49.31,79.66对应的坐标 程序怎么写? 以下代码在7.1版以上均可运行。 close all clear,clc x=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39]; y2=[0 3.75 10.95 19.95 29.3 38.45 46.85 54.50 61.55 68.00 73.85 78.95 83.75 88.25 92.3 95.9 99.2 102.2 104.9 107.3 109.55 111.65 113.6 115.4 117.05 118.55 119.9 121.1 122.15 123.05 123.8 124.4 124.85 125.25 125.61 125.91 126.11 126.26 126.36 126.44]; plot(x,y2); hold on; y3=126.44; plot(x,y3,'-'); % Set up fittype and options. ft = 'linearinterp'; opts = fitoptions( ft ); opts.Normalize = 'on'; % Fit model to data. fitresult = fit( y2', x', ft, opts ); yy1 = [49.31,79.66]; % y = [49.31,79.66] xx1 = fitresult( yy1 ); % 与y对应的x值 % 画点 标注 for i = 1:length(xx1) plot(xx1(i),yy1(i),'rs','MarkerEdgeColor','k','MarkerFaceColor','g','MarkerSize',6) text(xx1(i),yy1(i),['(',num2str(xx1(i),'%5.2f'),',',num2str(yy1(i),'%5.2f'),')'],'EdgeColor','red','BackgroundColor',[.7 .9 .7],'VerticalAlignment','bottom'); end
plot(5,38.45,'rs','MarkerEdgeColor','k','MarkerFaceColor','g','MarkerSize',5)
text(5,38.45,'(5,38.45)','EdgeColor','red','VerticalAlignment','bottom');
plot(38,126.36,'rs','MarkerEdgeColor','k','MarkerFaceColor','g','MarkerSize',5)
text(38,126.36,'(38,126.36)','EdgeColor','red','VerticalAlignment','bottom');
对未知坐标的点,可以先插值,再标出:
以下代码在7.1版以上均可运行.
close all
clear,clc
x=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39];
y2=[0 3.75 10.95 19.95 29.3 38.45 46.85 54.50 61.55 68.00 73.85 78.95 83.75 88.25 92.3 95.9 99.2 102.2 104.9 107.3 109.55 111.65 113.6 115.4 117.05 118.55 119.9 121.1 122.15 123.05 123.8 124.4 124.85 125.25 125.61 125.91 126.11 126.26 126.36 126.44];
plot(x,y2);
hold on;
y3=126.44;
plot(x,y3,'-');
% Set up fittype and options.
ft = 'linearinterp';
opts = fitoptions( ft );
opts.Normalize = 'on';
% Fit model to data.
fitresult = fit( x',y2',ft,opts );
xx1 = [6.321,11.15,21.15]; % x = [6.321,11.15,21.15]
yy1 = fitresult( xx1 ); % 与x对应的y值
% 画点 标注
for i = 1:length(xx1)
plot(xx1(i),yy1(i),'rs','MarkerEdgeColor','k','MarkerFaceColor','g','MarkerSize',6)
text(xx1(i),yy1(i),['(',num2str(xx1(i),'%5.2f'),',',num2str(yy1(i),'%5.2f'),')'],'EdgeColor','red','BackgroundColor',[.7 .9 .7],'VerticalAlignment','bottom');
end
再问: 我要标出y值为49.31,79.66对应的坐标 程序怎么写?
再答: 我要标出y值为49.31,79.66对应的坐标 程序怎么写? 以下代码在7.1版以上均可运行。 close all clear,clc x=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39]; y2=[0 3.75 10.95 19.95 29.3 38.45 46.85 54.50 61.55 68.00 73.85 78.95 83.75 88.25 92.3 95.9 99.2 102.2 104.9 107.3 109.55 111.65 113.6 115.4 117.05 118.55 119.9 121.1 122.15 123.05 123.8 124.4 124.85 125.25 125.61 125.91 126.11 126.26 126.36 126.44]; plot(x,y2); hold on; y3=126.44; plot(x,y3,'-'); % Set up fittype and options. ft = 'linearinterp'; opts = fitoptions( ft ); opts.Normalize = 'on'; % Fit model to data. fitresult = fit( y2', x', ft, opts ); yy1 = [49.31,79.66]; % y = [49.31,79.66] xx1 = fitresult( yy1 ); % 与y对应的x值 % 画点 标注 for i = 1:length(xx1) plot(xx1(i),yy1(i),'rs','MarkerEdgeColor','k','MarkerFaceColor','g','MarkerSize',6) text(xx1(i),yy1(i),['(',num2str(xx1(i),'%5.2f'),',',num2str(yy1(i),'%5.2f'),')'],'EdgeColor','red','BackgroundColor',[.7 .9 .7],'VerticalAlignment','bottom'); end
matlab怎么在图上标出具体点坐标?图上的坐标怎么标出?
怎么用matlab画离散点并在图上标出坐标
CASS软件中生成的图知道一个点坐标怎么标出其他点坐标
怎么可以在CAD图纸上同时标出x、y两个坐标?
在matlab画图中,已知某点横坐标,如何标出此点的主坐标值
怎样用matlab建立坐标系给图中已知点标出坐标?
matlab画图问题画出一条曲线,怎么在上边标出某些坐标的数值,而且这些坐标用黑框框标记,比如图示这样
cad里怎么标出一点的xy坐标
CAD世界坐标系中的图一般是斜的,怎么变成正的,而仍可以标出正确的坐标?
请问AUTOCAD中这类的坐标是怎么标出来的?都不知道以哪点为原点,
用matlab在平面上 随机产生几个点(用坐标表示)怎么编程?
用cass展好的点 怎么在图上显示出坐标