New install 2021a not plotting data

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 件のコメント

Konrad
Konrad 2021 年 7 月 23 日
Hi,
Y = [1;2;3;4];
plot(Y)
works for me in 2021a.
Maybe you have redefined your plot-function? Is there a plot.m file somewhere on your search path?
Best, Konrad
howe
howe 2021 年 7 月 23 日
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 2021 年 7 月 23 日
Yes, thats weird! I'd rerun the installer.

サインインしてコメントする。

回答 (2 件)

Steven Lord
Steven Lord 2021 年 7 月 23 日

0 投票

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 件のコメント

howe
howe 2021 年 7 月 26 日
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.

サインインしてコメントする。

howe
howe 2021 年 7 月 23 日

0 投票

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 件のコメント

howe
howe 2021 年 7 月 23 日
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

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品

リリース

R2021a

質問済み:

2021 年 7 月 23 日

コメント済み:

2021 年 7 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by