Decreasing the lag on the Android Matlab app sensor data .
Mostrar comentarios más antiguos
Hi,I am a total newbie to matlab. I been trying to get sensor data from my android phone. I am getting the data but there is almost a lag of 1 second. here is my code
clear all
close all
clc
connector on;
m = mobiledev();
m.OrientationSensor = 1;
m.Logging = 1;
pause (4)
for c = 1:inf
o = m.Orientation
pause(0.1);
figure(1);
axis tight
hold on
plot(c,o(1),'.');
figure(2);
axis tight
hold on
plot(c,o(2),'.');
figure(3);
axis tight
hold on
plot(c,o(3),'.');
end
Respuesta aceptada
Más respuestas (1)
kalvik jakkala
el 22 de Mayo de 2015
0 votos
1 comentario
Walter Roberson
el 23 de Mayo de 2015
The plot command goes right where I show it, in the loop that builds the figures and associated axes. After that, you do not call plot(): instead you use set() to update the XData and YData properties of the line() objects that were created by the plot() calls. Updating the XData and YData properties so that they have all of the data points will result in faster graphics than having one line() object for every point.
Categorías
Más información sobre Modeling en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!