Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Problem with insertRow in Matlab2012b

Subject: Problem with insertRow in Matlab2012b

From: Dennis B.

Date: 7 Mar, 2013 16:12:08

Message: 1 of 7

Dear Community,

I have a Problem with inserting a new row in a uitable in Matlab2012b . I tried it as i unterstand it in chapter 4.1.6 in Yair Altmans book "Undocumented Secrets of MATLAB-Java Programming."

% get the handle struct from the figure
GdlConfigDlgHandles_st = guidata(hGdlConfigDlg);
% get the table handle
hTable_ja = GdlConfigDlgHandles_st.tbl_hTable_ja;
%get the underlying java table handle
jScroll_ja = sc_findjobj(hTable_ja);
jTable_ja = jScroll_ja.getViewport.getView;

jTable_ja.getModel.insertRow(newRowIdx, newRowData);

But the function 'insertRow' does not exists.
Is this a new problem of the matlab 2012b version? Has the Java-API changed? If yes: Please explain to me, how i can fix this. I dont find any machting api-function :-/

Thanks and greetings
D.B.

Subject: Problem with insertRow in Matlab2012b

From: Dennis B.

Date: 11 Mar, 2013 07:24:05

Message: 2 of 7

No one has an idea or experience with Matlab2012b Java Components?

The Version should be the same as in Matlab2011b:

MATLAB Version 7.13.0.564 (R2011b)
MATLAB License Number: 490273
Operating System: Microsoft Windows 7 Version 6.1 (Build 7601: Service Pack 1)
Java VM Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode

MATLAB Version: 8.0.0.783 (R2012b)
MATLAB License Number: 490269
Operating System: Microsoft Windows 7 Version 6.1 (Build 7601: Service Pack 1)
Java Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode

Subject: Problem with insertRow in Matlab2012b

From: Steven_Lord

Date: 11 Mar, 2013 13:36:46

Message: 3 of 7



"Dennis B." <testhest@west.de> wrote in message
news:khk0ql$d7u$1@newscl01ah.mathworks.com...
> No one has an idea or experience with Matlab2012b Java Components?

If you're using undocumented functionality, as your reference to Yair's book
suggests, you probably should contact the official Technical Support group
for assistance.

*snip*

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: Problem with insertRow in Matlab2012b

From: Dennis B.

Date: 11 Mar, 2013 15:47:07

Message: 4 of 7

Thanks for your information,i will try this.

Subject: Problem with insertRow in Matlab2012b

From: Yair Altman

Date: 11 Mar, 2013 18:05:13

Message: 5 of 7

"Dennis B." wrote in message <khae8o$ilo$1@newscl01ah.mathworks.com>...
> Dear Community,
>
> I have a Problem with inserting a new row in a uitable in Matlab2012b . I tried it as i unterstand it in chapter 4.1.6 in Yair Altmans book "Undocumented Secrets of MATLAB-Java Programming."
>
> % get the handle struct from the figure
> GdlConfigDlgHandles_st = guidata(hGdlConfigDlg);
> % get the table handle
> hTable_ja = GdlConfigDlgHandles_st.tbl_hTable_ja;
> %get the underlying java table handle
> jScroll_ja = sc_findjobj(hTable_ja);
> jTable_ja = jScroll_ja.getViewport.getView;
>
> jTable_ja.getModel.insertRow(newRowIdx, newRowData);
>
> But the function 'insertRow' does not exists.
> Is this a new problem of the matlab 2012b version? Has the Java-API changed? If yes: Please explain to me, how i can fix this. I dont find any machting api-function :-/
>
> Thanks and greetings
> D.B.


As I mention at the beginning of the 4.1.6 section, the insertRow (and in fact the entire 4.1.6 section) only refers to the old (pre-R2008a) uitable, not to the new one.

I have not found corresponding functionality in the new uitable (maybe it exists and I am simply not aware of it).

Yair Altman
http://UndocumentedMatlab.com
 

Subject: Problem with insertRow in Matlab2012b

From: Dennis B.

Date: 12 Mar, 2013 07:21:06

Message: 6 of 7

Thanks for your response Yair.
I also checked nearly every api-interface function and then at least I know that I dont sit on my eyes.

But i asked the official support - we'll see.

Subject: Problem with insertRow in Matlab2012b

From: Dennis B.

Date: 13 Mar, 2013 12:37:05

Message: 7 of 7

Okay, i got a matlab support answer. The only way to add a row ist to use get(hTable_ja,'Data'); and set(hTable_ja,'Data',TblData) - there is no other undocumented way. Thats a pity.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us