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:
making a table

Subject: making a table

From: J G

Date: 22 Aug, 2010 22:27:06

Message: 1 of 5

Is it possible to have output data directly entered into a table? I have a loop which produces a series of vectors (one for every time the loop is run), eg.

1 2 3 4

5 6 7 8

etc. lets say for 100 times, and I would like this to be directly entered into a table every time the loop spits out another vector (the same table), ie. with 4 columns, 100 rows.

Subject: making a table

From: dpb

Date: 22 Aug, 2010 22:51:42

Message: 2 of 5

J G wrote:
> Is it possible to have output data directly entered into a table? I
> have a loop which produces a series of vectors (one for every time the
> loop is run), eg.
>
> 1 2 3 4
>
> 5 6 7 8
>
> etc. lets say for 100 times, and I would like this to be directly
> entered into a table every time the loop spits out another vector (the
> same table), ie. with 4 columns, 100 rows.

Assuming a "table" is simply a 2D array (matrix)

x = zeros(100,4);
for idx = 1:length(x)
   x(idx,:) = your_function_output(whatever_its_input);
end

--

Subject: making a table

From: Walter Roberson

Date: 22 Aug, 2010 23:09:16

Message: 3 of 5

On 22/08/10 5:27 PM, J G wrote:
> Is it possible to have output data directly entered into a table? I
> have a loop which produces a series of vectors (one for every time the
> loop is run), eg.
>
> 1 2 3 4
>
> 5 6 7 8
>
> etc. lets say for 100 times, and I would like this to be directly
> entered into a table every time the loop spits out another vector (the
> same table), ie. with 4 columns, 100 rows.

In MATLAB, "table" is used with respect to several technologies that are
internally quite different. Could you be more specific about what you
are wanting to do? For example, is this a question about uitable, or is
it a question about connecting to an SQL server?

Subject: making a table

From: J G

Date: 22 Aug, 2010 23:21:05

Message: 4 of 5

Sorry, I meant a uitable. Thanks

Subject: making a table

From: Walter Roberson

Date: 22 Aug, 2010 23:42:04

Message: 5 of 5

On 22/08/10 6:21 PM, J G wrote:
> Sorry, I meant a uitable. Thanks

Please see
http://www.mathworks.com/matlabcentral/newsreader/view_thread/281187 for
information on doing direct uitable updates.

You might have some logistic difficulties with respect to the entries
that you have not really initialized yet.

Tags for this Thread

No tags are associated with 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