how to super impose two images in matlab

1 次查看(过去 30 天)
Hi
I want to draw a rectangular with hight of 80km(-40 to 40) and wide of 40km(0 to 40).the next line give me a 80*40 rectangular but the horisontal edge is not from -40 to 40
rectangle('Position',[5 5 80 40])
and then I need to impose a series of points(56 points) with specified coordinate on it.
I have the coordinates in a textfile which I attached here.
I can plot those points,with next few line of cods but don't know how to plot them on the rectangular .
those points suppose to be placed on the middle upper part of the rectangular.
fid=fopen('FAULT_STATIONS.txt')
s=textscan(fid,'%d %d %d %s %d')
fclose(fid)
y=s{2}
z=s{3}
plot(y./1000, z./1000,'o')
would you please tell me how to super impose these 2 images
thank you
**if its possible I need to numbering them
1 9 17 25 33 41 49
2 10 18 26 34 42 50
3 11 19 27 35 43 51
4 12 20 28 36 44 52
5 13 21 29 37 45 53
6 14 22 30 38 46 54
7 15 23 31 39 47 55
8 16 24 32 40 48 56

采纳的回答

KSSV
KSSV 2019-6-3
编辑:KSSV 2019-6-3
fid=fopen('FAULT_STATIONS.txt') ;
s=textscan(fid,'%f %f %f %s %f') ;
fclose(fid) ;
y=s{2}/1000 ;
z=s{3}/1000 ;
plot(y, z,'.b')
rectangle('Position',[-40 -40 80 40])
str = num2str([1:length(y)]') ;
text(y,z,str)
  3 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

产品


版本

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by