Filter löschen
Filter löschen

How can I add and remove a specific row from a Table in the GUI?

2 Ansichten (letzte 30 Tage)
Jorge  Alvarado
Jorge Alvarado am 12 Dez. 2016
Kommentiert: Jorge Alvarado am 15 Dez. 2016
How can I add and remove a specific row from a Table in the GUI?

Antworten (1)

KSSV
KSSV am 15 Dez. 2016
clc; clear all ;
LastName = {'Smith';'Johnson';'Williams';'Jones';'Brown'};
Age = [38;43;38;40;49];
Height = [71;69;64;67;64];
Weight = [176;163;131;133;119];
BloodPressure = [124 93; 109 77; 125 83; 117 75; 122 80];
T = table(Age,Height,Weight,BloodPressure,...
'RowNames',LastName) ;
K = T ;
%%Say I want to remove the third row
K(3,:) = []
  2 Kommentare
David Barry
David Barry am 15 Dez. 2016
I assumed from the GUI comment that they were talking about uitable not a table data type.
Jorge  Alvarado
Jorge Alvarado am 15 Dez. 2016
thanks for your comments yes I was referring to add a new blank row after a specific row. The code I use is this:
datos=get(handles.uitable1, 'data');
ina=size(datos,1);
datos(ina+1,:)={''};
set(handles.uitable1, 'data', datos);
but in this case The new row is added after the last row of the table. And I would like for example to be added after the row 3. ?????

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Tables finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by