get number from table

How can I get one data(number) from a table to use it in a formula? I have a table with one column and I want to get for A= (value from 7. row and 1. column). (get(iutablename.'data' or indices. what?)

 Risposta accettata

Fangjun Jiang
Fangjun Jiang il 11 Nov 2011
d=get(uitableHandle,'data');
d7=d(7);

4 Commenti

laszlo csibrik
laszlo csibrik il 11 Nov 2011
Thx. I think it is working. but it I get error. where according the error message I dont have number in this cell. but it's a number of course... do you know what is the reason for this?
Walter Roberson
Walter Roberson il 11 Nov 2011
uitable stores things in a cell array, so
d7 = d{7,1};
Fangjun Jiang
Fangjun Jiang il 11 Nov 2011
@Walter, It's not true, Walter. If the data in the table is all numerical, it returns data array.
>> h=uitable('data',rand(3,4));
>> class(get(h,'data'))
ans =
double
laszlo csibrik
laszlo csibrik il 11 Nov 2011
now I get number but just in this way: d7=[d7(7,1)];
because the answer for this kind of bracket {} was it is not a non-cell array object... I'm just a basic user, but im happy to manage this finally :) and many thanks for your help.

Accedi per commentare.

Più risposte (0)

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by