PSINS工具箱的函数:
vp = getgnssvp(ephs, obss, tp, isfig)
如上图,最后是绘图的标记“isfig”,但是实际这个标记没有用到,原函数内容:
function vp = getgnssvp(ephs, obss, tp, isfig)
% see also findgpsobs.
global ggpsfindgpsobs(obss);recPos = [0,0,0,0]';if nargin<3, tp=-1; endfor k=1:100[obsi,tp] = findgpsobs(tp);if size(obsi,1)<=4, tp=tp+1; continue; end[satpv, clkerr, TGD, orbitp] = satPosVelBatch(obsi(1,1)-obsi(:,3)/ggps.c, ephs(obsi(:,2),:));[pvt, vp, res] = lspvt(recPos, satpv, [obsi(:,3)+clkerr(:,2)*ggps.c]);break;endif nargin>=4AzEl = satPos2AzEl(satpv, vp(4:6));satplot(obsi(:,2), AzEl);end
修复
我在函数末尾加上选择语句,按照习惯,当isfig == 0时,不绘图,isfig == 1时,绘图,修改后的函数如下:
function vp = EV_getgnssvp(ephs, obss, tp, isfig)
% see also findgpsobs.
global ggpsfindgpsobs(obss);recPos = [0,0,0,0]';if nargin<3, tp=-1; endfor k=1:100[obsi,tp] = findgpsobs(tp);if size(obsi,1)<=4, tp=tp+1; continue; end[satpv, clkerr, TGD, orbitp] = satPosVelBatch(obsi(1,1)-obsi(:,3)/ggps.c, ephs(obsi(:,2),:));[pvt, vp, res] = lspvt(recPos, satpv, [obsi(:,3)+clkerr(:,2)*ggps.c]);break;endif nargin>=4 && isfig == 1AzEl = satPos2AzEl(satpv, vp(4:6));satplot(obsi(:,2), AzEl);end