Hello I have an editable uitable in Matlab GUI. I have a pushbutton to clear the contents of the uitable that is entered by the user. However, anytime I clear the table and reenter text I get a NAN error.

조회 수: 4 (최근 30일)
The code I am using to clear the data is as follows.
set (handles.uitable1, 'data', cell(size(get(handles.uitable1,'data'))));
How do I prevent the NaN error so that I can reenter text into the table.

채택된 답변

Walter Roberson
Walter Roberson 2013년 12월 19일
I cannot reproduce the issue based on your code. What is your ColumnFormat set to for your uitable? Are you getting the NaN showing up in the table or when you process the table?
  댓글 수: 1
Vandana Ramdeo
Vandana Ramdeo 2013년 12월 19일
The column format is set to 'let matlab choose' so when I run the code, the user is able to enter text into the cells of the table. However, as soon as I use the push button I created to clear the contents of the uitable, if the user wants to enter text again into the cells of the uitable I am getting the NaN error. The code I'm using for the push button is the code seen above.

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

추가 답변 (2개)

Vandana Ramdeo
Vandana Ramdeo 2013년 12월 19일
The column format is set to 'let matlab choose' so when I run the code, the user is able to enter text into the cells of the table. However, as soon as I use the push button I created to clear the contents of the uitable, if the user wants to enter text again into the cells of the uitable I am getting the NaN error. The code I'm using for the push button is the code seen above.
  댓글 수: 1
ES
ES 2013년 12월 19일
set the column format to char. Your issue will be solved. You can do that by using the Property Inspector of your uitable or by using
set(handle.uitable,'columnformat',{'char'...});

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


Suraj Srivastava
Suraj Srivastava 2015년 2월 18일
Hi,
could you please help me for the same....I want to make GUI in which there is an UITABLE of 14*3......of first two columns are fixed while third one is not fixed. It should get input from the user manually.
Kindly Help me out.

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by