# How can I force a custom framerate over 20 frames per second from "drawnow limitrate"

조회 수: 10 (최근 30일)
Kevin Aghaei 2017년 8월 14일
답변: Faiz Gouri 2017년 8월 16일
Hello,
I am generating a realtime GUI plot and using drawnow to update the figure in real time. I want the frame rate to be 30, not 20 as limited by drawnow limitrate. Without limitrate applied, the drawnow function slows down with time and the graphics are no longer real time (this is important as the GUI must represent real time data from a serial input).
How can I have drawnow run at a custom framerate instead of 20 as forced by limitrate?
Here is the section of code where drawnow is implemented (towards the bottom):
while(j<50000)
% Import IMU Quaternion and convert to rotation matrix
gca;
idn = fscanf(s);
char(idn);
IMUdata = textscan(idn,'%f %f %f %f %f','Delimiter',',');
quat1 = IMUdata{1, 2};
quat2 = IMUdata{1, 3};
quat3 = IMUdata{1, 4};
quat4 = IMUdata{1, 5};
quat = [quat1, quat2, quat3, quat4];
rotm = qGetR(quat);
%%Drawing blue box
dcm = rotm;
P = [A;B;F;H;G;C;A;D;E;H;F;D;E;C;G;B];
%rotate about Center, but this is not good way to rotate about a point
for i=1:length(P)
P(i,:)=P(i,:)-Center;
end
P = P*dcm;
for i=1:length(P)
P(i,:)=P(i,:)+Center;
end
plot3(handles.axes2,P(:,1),P(:,2),P(:,3),'Color','b');hold on;
hold off;
axis([-2 2 -2 2 -2 2]);
grid on;
view([1,1,1]) ;
xlabel('X');
ylabel('Y');
zlabel('Z');
drawnow limitrate;
j=j+1;
cla(handles.axes2)
end;
Thank you,
Kevin

댓글을 달려면 로그인하십시오.

### 답변 (1개)

Faiz Gouri 2017년 8월 16일
The ability to modify the default rate of the DRAWNOW LIMITRATE command is not available in MATLAB and there is currently no workaround available to modify it.

댓글을 달려면 로그인하십시오.

### 카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

### Community Treasure Hunt

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

Start Hunting!

Translated by