Figure not showing up when attempting to plot array

조회 수: 4 (최근 30일)
Steven Bellefontaine
Steven Bellefontaine 2021년 2월 28일
댓글: Steven Bellefontaine 2021년 2월 28일
I am attempting to plot roll angles from an accelerometer with respect to time. The roll angles were imported as a .txt file and were stored as an array. Since data was taken every 0.01 seconds, I created another array of the same length with equal 0.01 increments to model time.
When I attempt to plot the roll angle vs. time, nothing pops up. I see a figure window when I hover over the matlab shortcup in my task bar, but nothing happens when I click on it. Maybe the arrays are too large?
Here is the code and I have also attached the .txt file:
clc,clear
roll = importdata('RollPID_2.50_0.003_2.05.txt');
roll = roll';
time = 0:0.01:177.16;
plot(time,roll,'b-')
Thanks,
SB

답변 (1개)

Jan
Jan 2021년 2월 28일
It takes only a second on my system (Win10 Matlab 2018b).
So either there is an open but hidden window or another problem. Check this:
allchild(groot)
Open a new figure explicitely:
figure;
axes;
plot(time,roll,'b-')
  댓글 수: 1
Steven Bellefontaine
Steven Bellefontaine 2021년 2월 28일
The allchild(groot) command showed the figure was created. I restarted my pc and added "figure;" and "axes;". It came up within a second or so after doing this.
Thank you for the assistance!

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

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by