New install 2021a not plotting data

15 views (last 30 days)
howe
howe on 23 Jul 2021
Commented: howe on 26 Jul 2021
Just upgraded from 2019b to 2021a. Standard workflow for plotting data not working in 2021a.
Variable: Y is 5500000x1 double containing reals from -500 to +500 at 4 decimal precision
Calling figure; plot(Y) gives this error:
Array indices must be positive integers or logical values.
Error in matlab.graphics.shape.internal.ScribeStackManager/findLayer
Error in matlab.graphics.shape.internal.ScribeStackManager/getLayer
Error in newplot (line 77)
ax = gca(fig);
Error in matlab.graphics.internal.newplotwrapper (line 11)
axReturn = newplot(varargin{:});
Same data, same command in 2019b plots without issue. Note, even setting Y = [1;2;3;4] and calling plot(Y) fails and gives same error. Is this an installation problem? Some weird incompatibility?
  3 Comments
howe
howe on 23 Jul 2021
Thanks Konrad. No, I haven't redefined anything - frankly just installed the update to 2021a less than an hour ago. I think my install must be glitchy.
Konrad
Konrad on 23 Jul 2021
Yes, thats weird! I'd rerun the installer.

Sign in to comment.

Answers (2)

Steven Lord
Steven Lord on 23 Jul 2021
Let's make sure you haven't accidentally written or downloaded a function that is taking precedence over the built-in functions and the functions included in MATLAB. What do these commands display?
which plot
built-in (/MATLAB/toolbox/matlab/graph2d/plot)
which gca
built-in (/MATLAB/toolbox/matlab/graphics/gca)
which newplot
/MATLAB/toolbox/matlab/graphics/axis/newplot.m
which get
built-in (/MATLAB/toolbox/matlab/graphics/objectsystem/get)
  1 Comment
howe
howe on 26 Jul 2021
Steven, as outlined below, none of the functions were overwritten. I reinstalled (clean) and got the same problem. Found a solution to fix the problem transiently (while in same session):
restoredefaultpath
rehash toolboxcache
savepath
So something is going wrong with the path.
I can live with this. But another problem has arisen: now I can't open apps, such as the Signal Analyzer. Matlab just hangs, indefinitely (like overnight if allowed), trying to open the app. Any thoughts on this would be appreciated, especially since: 1) R2019 was working perfectly in my hands for years; 2) I reinstalled R2021a twice and still have the same trouble. Thanks.

Sign in to comment.


howe
howe on 23 Jul 2021
Thanks Steven.
built-in (C:\Program Files\MATLAB\R2021a\toolbox\matlab\graph2d\plot)
built-in (C:\Program Files\MATLAB\R2021a\toolbox\matlab\graphics\gca)
C:\Program Files\MATLAB\R2021a\toolbox\matlab\graphics\axis\newplot.m
built-in (C:\Program Files\MATLAB\R2021a\toolbox\matlab\graphics\objectsystem\get)
Returns look correct.
  1 Comment
howe
howe on 23 Jul 2021
I am starting to get all sorts of weird errors. I suspect something didn't work correctly with the install. I was just running some basic calculations on arrays and got the following error chain:
Warning: Error occurred while executing the listener callback for event POST_REGION defined for class matlab.internal.language.RegionEvaluator:
Error using set
Too many input arguments.
set(rootobj,'ShowHiddenHandles','on');
Error in findall (line 37)
c = onCleanup(showHiddenHandlesToFindAllHandles(rootobj));
Error in matlab.internal.editor.FigureManager
Error in matlab.internal.editor.FigureManager
Error in matlab.internal.editor.FigureManager
Error in matlab.internal.editor.FigureManager.snapshotAllFigures
This is what I was wunning (as livescript):
eeg=A01D0;
efreq=1000; %1000 Hz sampling
epochlength=1000; %1 second at 1000 Hz
sz=length(eeg);
numepochs=floor(sz/epochlength)-1;
linelen=0;
L = zeros(numepochs,1);
for ct = 1:numepochs
start = (ct-1)*epochlength+1;
stop = ct*epochlength;
for e = start:stop
linelen = linelen + abs(eeg(e,1));
end
L(ct,1)=linelen;
linelen = 0;
end

Sign in to comment.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!