一些matlab新技能

matlab新技能

直接读取mat文件内结构体中的变量

value = cell2mat(struct2cell(load(filelist(1).name)));

三维数组转置一维二维

permute(value2,[2 1 3]);

二维经纬度加变量绘制地图

geoshow( lat, lon, value, ,'DisplayType','texturemap' );
colormap ( flipud(gray) );
caxis ( [250 320] );
xlim ([80 130]);
ylim ([10 60]);
xlabel('Longitude','FontSize',16);
ylabel('Latitude','FontSize',16);
set (gca,'XColor','k','YColor','k','LineWidth',1.5);
txt_file = file(1:25);
title (num2str(txt_file),'FontSize',16);

上下翻转

flipud

左右翻转

fliplr

重新排列

reshape(A,8,1)
A转为8行1列

站点分布图

clear;
clc;

for i = 1:size (anhui_sites,1)-1
    scatter (anhui_sites(i,3),anhui_sites(i,2),70,'k','filled');
    hold on;
    scatter (anhui_sites(i+1,3),anhui_sites(i+1,2),70,'k','filled');
end
clear i;
hold on;

linetower = xlsread('latlon.xlsx');
for i = 1:size (linetower,1)-1
    plot ( [ linetower(i,1) linetower(i,3)], [ linetower(i,2) linetower(i,4)],'r','LineWidth',3 );
    hold on;
    plot ( [ linetower(i+1,1) linetower(i+1,3)], [ linetower(i+1,2) linetower(i+1,4)],'r','LineWidth',3 );
end
hold on;

for i = 1:size (linetower,1)
    %     scatter (linetower(i,1),linetower(i,2),70,'r^','filled');
    %     hold on;
    %     scatter (linetower(i+1,3),linetower(i+1,4),70,'r^','filled');
    scatter (linetower(i,1),linetower(i,2),70,'r^','filled');
    hold on;
    scatter (linetower(i,3),linetower(i,4),70,'r^','filled');
    
end
clear i;
hold on;

map = 'D:\satellite\chinamap\diquJie_polyline.shp';
geoshow(map,'linewidth',1, 'Color', [0 0 0]);
hold on;
map_all =  'D:\satellite\chinamap\bou2_4l.shp';
geoshow(map_all,'linewidth',1, 'Color', [0 0 0]);
xlabel('Longitude','FontSize',16);
ylabel('Latitude','FontSize',16);
set (gca,'XColor','k','YColor','k','LineWidth',1.5);
xlim ([115 120]);
ylim ([29 32]);
set (gca, 'box','on');
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值