z = 0:0.05:10; y = sin(2*z); x = cos(2*z); curve = animatedline('LineWidth',2); set(gca,'XLim',[-1.5 1.5],'YLim',[-1.5 1.5],'ZLim',[0 10]); view(43,24); hold on; for i=1:length(z) addpoints(curve,x(i),y(i),z(i)); head = scatter3(x(i),y(i),z(i),'filled','MarkerFaceColor','b'); drawnow pause(0.01); delete(head); end Cheers man, this is exactly what I was looking for!
can you create 3D graph data from both accelerometer and gyro data from arduino to matlab together? I have sensor data which is basically a timestamp, and a column of X, Y, Z of acceleration and roll, pitch, yaw of gyro. Can you help me please ???
z = 0:0.05:10;
y = sin(2*z);
x = cos(2*z);
curve = animatedline('LineWidth',2);
set(gca,'XLim',[-1.5 1.5],'YLim',[-1.5 1.5],'ZLim',[0 10]);
view(43,24);
hold on;
for i=1:length(z)
addpoints(curve,x(i),y(i),z(i));
head = scatter3(x(i),y(i),z(i),'filled','MarkerFaceColor','b');
drawnow
pause(0.01);
delete(head);
end
Cheers man, this is exactly what I was looking for!
thats very kind of you!
تسلم خالد . ان شاء الله يكون الاشي مفيد
MVP right here!
that was awesome
can you create 3D graph data from both accelerometer and gyro data from arduino to matlab together? I have sensor data which is basically a timestamp, and a column of X, Y, Z of acceleration and roll, pitch, yaw of gyro. Can you help me please ???
is there a same code that works for octave?
Thank you :) Very good Tuto
Cool man, thanks!
thanks man !!!!
thanks a lot (y) :)
How to save animation in matlab?
Create gif file.
addpoints(curve,x(i),y(i),z(i));
head=scatter3(x(i),y(i),z(i),'^','filled','MarkerFaceColor','b');
drawnow
pause(0.01)
% Creating a gif file
frame = getframe(1);
im = frame2im(frame);
[imind,cm] = rgb2ind(im,256);
if i == 1;
imwrite(imind,cm,filename,'gif', 'Loopcount',inf); % inf for continous loop of animation
else
imwrite(imind,cm,filename,'gif','WriteMode','append');
end
delete(head);