<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/259887</link>
    <title>MATLAB Central Newsreader - uitable help</title>
    <description>Feed for thread: uitable help</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Wed, 02 Sep 2009 06:20:03 -0400</pubDate>
      <title>uitable help</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/259887#677503</link>
      <author>ben </author>
      <description>*I can add a table to my gui by this code:&lt;br&gt;
mytable = uitable; &lt;br&gt;
set(mytable,'Data',magic(10))&lt;br&gt;
set(mytable,'ColumnWidth',{25})&lt;br&gt;
&lt;br&gt;
*Or i can add a table by dragging table icon from left frame in GUIDE Layout editor.&lt;br&gt;
&lt;br&gt;
But when i add a table with Layout editor, i can't access to it from m file, because i don't know how to manipulate like&lt;br&gt;
set(mytable,'Data',magic(10))&lt;br&gt;
&lt;br&gt;
because i don't know the name of the table, it is not &quot;mytable&quot;.&lt;br&gt;
Can you help me please?</description>
    </item>
    <item>
      <pubDate>Wed, 02 Sep 2009 13:10:19 -0400</pubDate>
      <title>Re: uitable help</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/259887#677593</link>
      <author>Andy </author>
      <description>&quot;ben &quot; &amp;lt;controlusc@gmail.com&amp;gt; wrote in message &amp;lt;h7l2qj$9qs$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; *I can add a table to my gui by this code:&lt;br&gt;
&amp;gt; mytable = uitable; &lt;br&gt;
&amp;gt; set(mytable,'Data',magic(10))&lt;br&gt;
&amp;gt; set(mytable,'ColumnWidth',{25})&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; *Or i can add a table by dragging table icon from left frame in GUIDE Layout editor.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; But when i add a table with Layout editor, i can't access to it from m file, because i don't know how to manipulate like&lt;br&gt;
&amp;gt; set(mytable,'Data',magic(10))&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; because i don't know the name of the table, it is not &quot;mytable&quot;.&lt;br&gt;
&amp;gt; Can you help me please?&lt;br&gt;
&lt;br&gt;
Drag the table into your figure, then right click on it and select &quot;Property Inspector&quot;.  Change the &quot;tag&quot; field to whatever you want the table to be called.</description>
    </item>
    <item>
      <pubDate>Wed, 02 Sep 2009 18:29:06 -0400</pubDate>
      <title>Re: uitable help</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/259887#677689</link>
      <author>ben </author>
      <description>I tried that but It didn't worked.&lt;br&gt;
&lt;br&gt;
Tag name of the table is uitable2&lt;br&gt;
&lt;br&gt;
when i give command as&lt;br&gt;
set(uitable2,'Data',magic(10))&lt;br&gt;
&lt;br&gt;
the error is &quot;??? Undefined function or variable 'uitable2'.&quot;&lt;br&gt;
&lt;br&gt;
Can you make an example please&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&quot;Andy &quot; &amp;lt;theorigamist@gmail.com&amp;gt; wrote in message &amp;lt;h7lqrr$6b5$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;ben &quot; &amp;lt;controlusc@gmail.com&amp;gt; wrote in message &amp;lt;h7l2qj$9qs$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; *I can add a table to my gui by this code:&lt;br&gt;
&amp;gt; &amp;gt; mytable = uitable; &lt;br&gt;
&amp;gt; &amp;gt; set(mytable,'Data',magic(10))&lt;br&gt;
&amp;gt; &amp;gt; set(mytable,'ColumnWidth',{25})&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; *Or i can add a table by dragging table icon from left frame in GUIDE Layout editor.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; But when i add a table with Layout editor, i can't access to it from m file, because i don't know how to manipulate like&lt;br&gt;
&amp;gt; &amp;gt; set(mytable,'Data',magic(10))&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; because i don't know the name of the table, it is not &quot;mytable&quot;.&lt;br&gt;
&amp;gt; &amp;gt; Can you help me please?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Drag the table into your figure, then right click on it and select &quot;Property Inspector&quot;.  Change the &quot;tag&quot; field to whatever you want the table to be called.</description>
    </item>
    <item>
      <pubDate>Wed, 02 Sep 2009 19:05:23 -0400</pubDate>
      <title>Re: uitable help</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/259887#677696</link>
      <author>matt dash</author>
      <description>&quot;ben &quot; &amp;lt;controlusc@gmail.com&amp;gt; wrote in message &amp;lt;h7mdhi$ftg$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I tried that but It didn't worked.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Tag name of the table is uitable2&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; when i give command as&lt;br&gt;
&amp;gt; set(uitable2,'Data',magic(10))&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; the error is &quot;??? Undefined function or variable 'uitable2'.&quot;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Can you make an example please&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;Andy &quot; &amp;lt;theorigamist@gmail.com&amp;gt; wrote in message &amp;lt;h7lqrr$6b5$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &quot;ben &quot; &amp;lt;controlusc@gmail.com&amp;gt; wrote in message &amp;lt;h7l2qj$9qs$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; *I can add a table to my gui by this code:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; mytable = uitable; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; set(mytable,'Data',magic(10))&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; set(mytable,'ColumnWidth',{25})&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; *Or i can add a table by dragging table icon from left frame in GUIDE Layout editor.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; But when i add a table with Layout editor, i can't access to it from m file, because i don't know how to manipulate like&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; set(mytable,'Data',magic(10))&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; because i don't know the name of the table, it is not &quot;mytable&quot;.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Can you help me please?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Drag the table into your figure, then right click on it and select &quot;Property Inspector&quot;.  Change the &quot;tag&quot; field to whatever you want the table to be called.&lt;br&gt;
&lt;br&gt;
no, it will be called handles.uitable2. That's how the tags work. </description>
    </item>
    <item>
      <pubDate>Wed, 02 Sep 2009 19:10:19 -0400</pubDate>
      <title>Re: uitable help</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/259887#677701</link>
      <author>ben </author>
      <description>i also tried&lt;br&gt;
&lt;br&gt;
set(handles.uitable2,'Data',magic(10))&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&quot;ben &quot; &amp;lt;controlusc@gmail.com&amp;gt; wrote in message &amp;lt;h7mdhi$ftg$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I tried that but It didn't worked.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Tag name of the table is uitable2&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; when i give command as&lt;br&gt;
&amp;gt; set(uitable2,'Data',magic(10))&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; the error is &quot;??? Undefined function or variable 'uitable2'.&quot;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Can you make an example please&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;Andy &quot; &amp;lt;theorigamist@gmail.com&amp;gt; wrote in message &amp;lt;h7lqrr$6b5$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &quot;ben &quot; &amp;lt;controlusc@gmail.com&amp;gt; wrote in message &amp;lt;h7l2qj$9qs$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; *I can add a table to my gui by this code:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; mytable = uitable; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; set(mytable,'Data',magic(10))&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; set(mytable,'ColumnWidth',{25})&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; *Or i can add a table by dragging table icon from left frame in GUIDE Layout editor.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; But when i add a table with Layout editor, i can't access to it from m file, because i don't know how to manipulate like&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; set(mytable,'Data',magic(10))&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; because i don't know the name of the table, it is not &quot;mytable&quot;.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Can you help me please?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Drag the table into your figure, then right click on it and select &quot;Property Inspector&quot;.  Change the &quot;tag&quot; field to whatever you want the table to be called.</description>
    </item>
    <item>
      <pubDate>Wed, 02 Sep 2009 19:23:31 -0400</pubDate>
      <title>Re: uitable help</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/259887#677705</link>
      <author>Nathan</author>
      <description>On Sep 2, 12:10&#160;pm, &quot;ben &quot; &amp;lt;control...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; i also tried&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; set(handles.uitable2,'Data',magic(10))&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &quot;ben &quot; &amp;lt;control...@gmail.com&amp;gt; wrote in message &amp;lt;h7mdhi$ft...@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; I tried that but It didn't worked.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Tag name of the table is uitable2&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; when i give command as&lt;br&gt;
&amp;gt; &amp;gt; set(uitable2,'Data',magic(10))&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; the error is &quot;??? Undefined function or variable 'uitable2'.&quot;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Can you make an example please&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &quot;Andy &quot; &amp;lt;theorigam...@gmail.com&amp;gt; wrote in message &amp;lt;h7lqrr$6b...@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &quot;ben &quot; &amp;lt;control...@gmail.com&amp;gt; wrote in message &amp;lt;h7l2qj$9q...@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *I can add a table to my gui by this code:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; mytable = uitable;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; set(mytable,'Data',magic(10))&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; set(mytable,'ColumnWidth',{25})&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *Or i can add a table by dragging table icon from left frame in GUIDE Layout editor.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; But when i add a table with Layout editor, i can't access to it from m file, because i don't know how to manipulate like&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; set(mytable,'Data',magic(10))&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; because i don't know the name of the table, it is not &quot;mytable&quot;.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Can you help me please?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Drag the table into your figure, then right click on it and select &quot;Property Inspector&quot;. &#160;Change the &quot;tag&quot; field to whatever you want the table to be called.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&lt;br&gt;
Where are you trying this?&lt;br&gt;
Did you remember to update the handles?&lt;br&gt;
&lt;br&gt;
Normally, if you created (and saved) a uitable in GUIDE, assuming you&lt;br&gt;
changed the tag to 'uitable2', you should be able to access the&lt;br&gt;
information in this uitable through its handles properies:&lt;br&gt;
set(handles.uitable2,'Data',magic(10));&lt;br&gt;
&lt;br&gt;
For example, I have this code in a checkbox7 callback. My uitable's&lt;br&gt;
tag is uitable1:&lt;br&gt;
&lt;br&gt;
checkbox = get(handles.checkbox7,'Value');&lt;br&gt;
if checkbox&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set(handles.uitable1,'Data',rand(3,2)*10)&lt;br&gt;
else&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set(handles.uitable1,'Data',zeros(size(get&lt;br&gt;
(handles.uitable1,'Data'))))&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
Are you saying that this still doesn't work?&lt;br&gt;
If so: where are you putting this code?&lt;br&gt;
Are you trying to run the GUI and then trying to set the data through&lt;br&gt;
the matlab command prompt?&lt;br&gt;
&lt;br&gt;
-Nathan</description>
    </item>
    <item>
      <pubDate>Wed, 02 Sep 2009 19:28:04 -0400</pubDate>
      <title>Re: uitable help</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/259887#677706</link>
      <author>Andy </author>
      <description>&quot;ben &quot; &amp;lt;controlusc@gmail.com&amp;gt; wrote in message &amp;lt;h7mfur$mu7$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; i also tried&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; set(handles.uitable2,'Data',magic(10))&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;ben &quot; &amp;lt;controlusc@gmail.com&amp;gt; wrote in message &amp;lt;h7mdhi$ftg$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; I tried that but It didn't worked.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Tag name of the table is uitable2&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; when i give command as&lt;br&gt;
&amp;gt; &amp;gt; set(uitable2,'Data',magic(10))&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; the error is &quot;??? Undefined function or variable 'uitable2'.&quot;&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Can you make an example please&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &quot;Andy &quot; &amp;lt;theorigamist@gmail.com&amp;gt; wrote in message &amp;lt;h7lqrr$6b5$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &quot;ben &quot; &amp;lt;controlusc@gmail.com&amp;gt; wrote in message &amp;lt;h7l2qj$9qs$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *I can add a table to my gui by this code:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; mytable = uitable; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; set(mytable,'Data',magic(10))&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; set(mytable,'ColumnWidth',{25})&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; *Or i can add a table by dragging table icon from left frame in GUIDE Layout editor.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; But when i add a table with Layout editor, i can't access to it from m file, because i don't know how to manipulate like&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; set(mytable,'Data',magic(10))&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; because i don't know the name of the table, it is not &quot;mytable&quot;.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Can you help me please?&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Drag the table into your figure, then right click on it and select &quot;Property Inspector&quot;.  Change the &quot;tag&quot; field to whatever you want the table to be called.&lt;br&gt;
&lt;br&gt;
Where are you putting this command?  I just created a GUI in GUIDE with a table, and set its CreateFcn to the following:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;function uitable1_CreateFcn(hObject, eventdata, handles)&lt;br&gt;
&amp;nbsp;&amp;nbsp;% hObject    handle to uitable1 (see GCBO)&lt;br&gt;
&amp;nbsp;&amp;nbsp;% eventdata  reserved - to be defined in a future version of MATLAB&lt;br&gt;
&amp;nbsp;&amp;nbsp;% handles    empty - handles not created until after all CreateFcns called&lt;br&gt;
&amp;nbsp;&amp;nbsp;set(hObject,'Data',magic(10));&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
This worked correctly for me.</description>
    </item>
  </channel>
</rss>

