Matlab 2018b, ginput(), and tabbed figures

조회 수: 7 (최근 30일)
Justin Brubaker
Justin Brubaker 2018년 10월 23일
댓글: Jenny Khuon 2020년 6월 11일
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
Dan Hensley
Dan Hensley 2018년 12월 5일
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 2018년 12월 5일
I just discovered that this bug has been fixed in R2018b update 1. The bug number is 1873881.

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

답변 (1개)

Samuel Bignardi
Samuel Bignardi 2018년 11월 12일
편집: Samuel Bignardi 2018년 11월 12일
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
Jenny Khuon
Jenny Khuon 2020년 6월 11일
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 2020년 6월 11일
I could not share program and data due to my job type. I hope you got the picture.

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

카테고리

Help CenterFile Exchange에서 Data Exploration에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by