I need to save previous adjacent position of object movement

1 次查看(过去 30 天)
hello everyone!
I have faced the problem is that i need to save previous adjacent position of object in order to identify the difference of object. Here is my code and i need to save the previous adjacent value of Rx. thanks
%%% Move Rx around the room according to Position vector above %%%%
%%% and measure the received power at Rx %%%%%%%%%%
for xx=1:1:no_of_moves_in_x
for yy=1:1:no_of_moves_in_y
Rx = get_Rx_position(Rx_pos_x(xx), Rx_pos_y(yy));
end
end

回答(1 个)

Chunru
Chunru 2021-8-5
RxPre = [0 0]; % initial position
for xx=1:1:no_of_moves_in_x
for yy=1:1:no_of_moves_in_y
Rx = get_Rx_position(Rx_pos_x(xx), Rx_pos_y(yy));
% Do comparison of Rx and RxPre here
RxPre = Rx;
end
end

类别

Help CenterFile Exchange 中查找有关 Graphics Object Properties 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by