Matlab 2018b, ginput(), and tabbed figures

11 visualizzazioni (ultimi 30 giorni)
Justin Brubaker
Justin Brubaker il 23 Ott 2018
Commentato: Jenny Khuon il 11 Giu 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 Commenti
Dan Hensley
Dan Hensley il 5 Dic 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 il 5 Dic 2018
I just discovered that this bug has been fixed in R2018b update 1. The bug number is 1873881.

Accedi per commentare.

Risposte (1)

Samuel Bignardi
Samuel Bignardi il 12 Nov 2018
Modificato: Samuel Bignardi il 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 Commenti
Jenny Khuon
Jenny Khuon il 11 Giu 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 il 11 Giu 2020
I could not share program and data due to my job type. I hope you got the picture.

Accedi per commentare.

Categorie

Scopri di più su Data Exploration in Help Center e File Exchange

Prodotti


Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by