资源简介
基于matlab的GPS数据读取,使用的是HOLUX的M-215+,主要读取的GPRMC格式的,其他数据依法可推,以供参考
代码片段和文件信息
delete(instrfindall); %delete all the serial port that may be in use
clear all;
close all;
clc;
s = serial(‘com6‘); %choose the serial port
s.BaudRate = 4800; %for m-215+ baudrate must be set as 4800
s.Terminator = ‘CR‘;
s.InputBufferSize = 1024;
s.OutputBufferSize = 1024;
s.ReadAsyncMode = ‘continuous‘;
fopen(s);
buf = fread(s);
buf = buf‘;
Vel_Int = [];
Vel_Dec = [];
Vel = [];
Col_Num = 0;
index_line = [];
i_RMC = 0;
%------------------Seperate the GPS data to multi lines-----------
a = find(buf == 13);b = find(buf == 10);
for i = 1:length(a)
buf(i) = [];
end
for i = 1:length(b)
buf(i) = [];
end
index_line = find(buf==‘$‘);%find the ‘$‘ as the mark to a new line
% index_line = [1index_line];
for i = 1:length(index_line)-1 %determine the column number of buf2
a = index_line(i+1)-index_line(i);
if Col_Num < a
Col_Num = a;
end
end
Col_Num = Col_Num + 1;
buf2 = zeros(length(index_line)Col_Num);%save the GPS data after seperated
for i = 1:length(index_line)-1
buf2(i1:index_line(i+1)-
相关资源
- match_filter(匹配滤波代码matlab
- Matlab2016b + VS2017
- Mie散射Matlab源代码
- matlab对矩阵进行LDLT和cholesky分解
- matlab录音与音频处理GUI界面
- Louvain算法Matlab版本
- 爬山算法matlab程序
- magnify matlab用放大局部绘图程序
- 局部加权回归的MATLAB实现机器学习之
- matlab 读取envi标准格式文件
- 《SeDuMi — 基于matlab的优化软件》帮助
- 图像分类matlab代码
- MATLAB 曲面拟合
- Matlab Hu矩7个不变矩源码
- NURBS_MATLAB
- matlab_非线性时滞系统的仿真程序
- 卷积码仿真程序matlab仿真,得到误码
- SCMA调制解调matlab仿真代码
- PID控制器与状态反馈控制器MATLAB教学
- MATLAB实现人眼定位程序
- DCO_OFDM程序代码
- Matlab生成Voronoi图代码
-
将txt转成voc数据集标准xm
lmatlab的 - MATLAB实现DCCA算法
- MATLAB环境下的基于HMM模型的语音识别
- SAR雷达回波仿真matlab
- MATLAB GUI实现动态画图曲线的源程序代
- 雨流计数法MATLAB源码
- 24脉波整流matlab仿真
- matlab图像特征点匹配
评论
共有 条评论