Matlab 2018b, ginput(), and tabbed figures

7 vues (au cours des 30 derniers jours)
Justin Brubaker
Justin Brubaker le 23 Oct 2018
Commenté : Jenny Khuon le 11 Juin 2020
I have a code set that works in 2017a but does not work in 2018b. I have traced the issue down a problem within the ginput() function when using a tabbed figure (my code works if I eliminate the tabbed figure). The error message that I get is:
Dot indexing is not supported for variables of this type.
Error in ginput>setupFcn (line 221) initialState.toolbarVisible{1} = tb.Visible;
Error in ginput (line 60) initialState = setupFcn(fig);
Here are two simplified versions of the code:
1. Version that doesn't work in 2018b but does in 2017a
a = 1:100; f = figure(100); clf
tabgp = uitabgroup(f, 'Position', [0.05 0.05 0.90 0.90]); tabgp.Units = 'pixels';
tab1 = uitab(tabgp, 'Title', 'Tab 1'); tab1.BackgroundColor = [1.0 1.0 1.0]; tab1.ForegroundColor = [0.3 0.3 0.3];
tab2 = uitab(tabgp, 'Title', 'Tab 2'); tab2.BackgroundColor = [1.0 1.0 1.0]; tab2.ForegroundColor = [0.3 0.3 0.3];
axes('parent', tab1)
subplot(5, 1, 1) plot(a)
subplot(5, 1, 2) plot(a)
[x,y] = ginput()
2. Version that works in both 2018b and 2017a
a = 1:100; f = figure(100); clf
subplot(5, 1, 1) plot(a)
subplot(5, 1, 2) plot(a)
[x,y] = ginput()
Has anyone encountered this? Any fixes?
  2 commentaires
Dan Hensley
Dan Hensley le 5 Déc 2018
I ran into this with an axis whose parent is a uipanel and not the base figure. I don't have any workaround. I submitted a bug report to Mathworks, as this has worked for many, many years. Hopefully they will have a workaround.
Here's a simple way to reproduce this bug:
hf = figure;
hp = uipanel;
plot(1:10,rand(1:10));
set(gca,'Parent',hp)
[x,y] = ginput(1)
Dan Hensley
Dan Hensley le 5 Déc 2018
I just discovered that this bug has been fixed in R2018b update 1. The bug number is 1873881.

Connectez-vous pour commenter.

Réponses (1)

Samuel Bignardi
Samuel Bignardi le 12 Nov 2018
Modifié(e) : Samuel Bignardi le 12 Nov 2018
I encounter the same problem. I got it work by excluding few of the original lines (SEE THE ATTACHMENT)
It is just a temporary workaround.
My best,
Samuel Bignardi
  2 commentaires
Jenny Khuon
Jenny Khuon le 11 Juin 2020
I got it work already. It is about case letter, lower and upper case issue.
I kept reading doccument and googling, and I found out that it works on upper case letter in 2017a, but not 2018b. 2018b requires lower case.
I have tested on 2017a and 2018b by using lower case letter, and it works.
Thank you all.
Jenny Khuon
Jenny Khuon le 11 Juin 2020
I could not share program and data due to my job type. I hope you got the picture.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Data Exploration dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by