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

Learn moreOpportunities for recent engineering grads.

Apply TodayTo resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

Asked by Melvin on 7 Sep 2012

Hi everyone! I am working on a project where I will be using Matlab GUIDE/GUI. What I want to happen actually focuses on a component in GUIDE called the Table.

Here's how I want the program to work: The table in GUIDE (let's say m by n) is initially empty(no values). When the program is executed/ran, I want to input the given to the cells of the table (Not all cells are occupied there are still some cells empty). As I click a button perhaps, there will be calculations being processed and then I want the results (many of them) to come out of the empty cells in the table. So if you look at the table, all cells are now occupied (consisting of the given and the results). Thus, the table is completed.

Now, my problems are: 1. I do not know how to set-up the table such that I can input values when the program is executed. 2. What code should I use to "get" the inputted given values so that I can perform calculations? 3. What code should I use to "show" the results from the calculation to the vacant cells of the table.

Please help me in this. Better yet, may I ask for links which is related to my concern. Thank you very much.

PS: My program is a Load Flow Analyzer specifically on Gauss Seidel Method. Thank you! :)

*No products are associated with this question.*

Answer by Leah on 7 Sep 2012

You might want to start here.

http://www.mathworks.com/help/techdoc/creating_guis/f3-998197.html

If you are familiar with handles in matlab that is similar to how you update data in GUI components.

Answer by Image Analyst on 7 Sep 2012

Edited by Image Analyst on 7 Sep 2012

Melvin, you just set up an array to hold your numbers, then set the 'data' property of the table:

tableData = rand(2,2); set(handles.uitable1, 'data', tableData);

Show 1 older comment

Le Huy on 10 Apr 2014

hello every body! I got the same problem with Melvin that is: I want to set my results those have an unfixed size of array to the UITABLE on my GUI! so how can I do it?And how is the code to use with this situation? sincerely!

Image Analyst on 11 Apr 2014

I don't understand the grammar of this "I want to set my results those have an unfixed size of array to the UITABLE on my GUI!" Perhaps get another English speaker to proofread it.

## 0 Comments