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:
Programattically Distribute UITABLES

Subject: Programattically Distribute UITABLES

From: Eric W

Date: 16 Mar, 2009 14:32:17

Message: 1 of 1

Hi,

I'm looking to programmatically distribute N uicontrols (uitables) across 2 rows in a uicontrol panel. I've been playing around with meshgrid and I just can't think of a good way to do what I want. Assume a nominal value of 6 uitables, making the figure look like a 2x3 grid of UITABLES within a uipanel.

[x,y] = meshgrid(linspace(0,1,3),linspace(0,1,2))

for jj = 1:2*3
disp([x(jj) y(jj)])
end

     0 0

     0 1

    0.5000 0

    0.5000 1.0000

     1 0

     1 1

This gives me the co-ordinates of the
[bottom left; top left; top center; top center; bottom center; bottom right; top right] corners of each table, with no spacing. I'd like to be able to somehow generate the bottom left corner for each one with some padding, but I can't think of a simple way of doing this.

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