正态图上的动态极坐标图

时间:2014-03-11 19:02:22

标签: matlab matlab-figure

请求大力帮助。我试图在正常情节上使用动态极坐标图。我有一个随机的航路点模型。现在,我想提出一个动态变化的极坐标图,以便在随机路点中找到几个选定的用户。

function test_Animate(s_mobility,s_input,time_step)

v_t = 0:time_step:s_input.SIMULATION_TIME;


for nodeIndex = 1:s_mobility.NB_NODES
    %Simple interpolation (linear) to get the position, anytime.
    %Remember that "interp1" is the matlab function to use in order to
    %get nodes' position at any continuous time.
    vs_node(nodeIndex).v_x = interp1(s_mobility.VS_NODE(nodeIndex).V_TIME,s_mobility.VS_NODE(nodeIndex).V_POSITION_X,v_t);

    vs_node(nodeIndex).v_y = interp1(s_mobility.VS_NODE(nodeIndex).V_TIME,s_mobility.VS_NODE(nodeIndex).V_POSITION_Y,v_t);


end
fig = figure;

hold on;


   for nodeIndex = 1:s_mobility.NB_NODES




    vh_node_pos(nodeIndex) =   plot(vs_node(nodeIndex).v_x(1),vs_node(nodeIndex).v_y(1),'*','color',[0.3 0.3 1]);



    axis off;

end
title(cat(2,'Simulation time (sec): ',num2str(s_mobility.SIMULATION_TIME)));
xlabel('X (meters)');
ylabel('Y (meters)');
title('Random Waypoint mobility');
ht = text(min(vs_node(1).v_x),max(vs_node(1).v_y),cat(2,'Time (sec) = 0'));
axis([min(vs_node(1).v_x) max(vs_node(1).v_x) min(vs_node(1).v_y) max(vs_node(1).v_y)]);
disp(min(vs_node(1).v_x));
disp(max(vs_node(1).v_x));
disp(min(vs_node(1).v_y));
disp(max(vs_node(1).v_y));

hold off;
for timeIndex = 1:length(v_t);
    t = v_t(timeIndex);
    set(ht,'String',cat(2,'Time (sec) = ',num2str(t,4)));
    for nodeIndex = 1:s_mobility.NB_NODES
              set(vh_node_pos(nodeIndex),'XData',vs_node(nodeIndex).v_x(timeIndex),'YData',vs_node(nodeInd ex).v_y(timeIndex));
        curr_x_pos=vs_node(nodeIndex).v_x(timeIndex);
      %  curr_y_pos=vs_node(nodeIndex).v_y(timeIndex);
        %disp(curr_x_pos);
        %curr_y_pos=vs_node(nodeIndex).v_y(timeIndex);

    end
    drawnow;
  end

  end

现在,在上面的代码中,我需要添加一个具有定向天线波束的极坐标图。请帮助我根据用户位置改变光束位置,我们可以在图上看到。如同,梁应动态环绕用户位置。关于此的其他文件是当前代码在以下链接中。 RANDOM WAYPOINT MOBILITY MODEL。请求大帮助。

提前致谢。

0 个答案:

没有答案
相关问题