how to fetch data from table?
显示 更早的评论
hello, i want to fetch data from two tables. i created the tables but i dont know how to fetch the datas.
function [z] = pushbutton1_Callback(hObject, eventdata, handles)
global nbb
global ntl
global ngn
global t1
a=findobj(gcbf,'TAG','edit1'); % bus say?s? girdigimiz text'i a'ya atad?k.
b=findobj(gcbf,'TAG','edit2'); % hat sayisi girdigimiz text'i b'ye atad?k.
c=findobj(gcbf,'TAG','edit3'); % jeneratör say?s? girdigimiz text'i c'ye atad?k.
bs=get(a,'string');
hs=get(b,'string');
gs=get(c,'string');
nbb=str2num(bs)
ntl=str2num(hs)
ngn=str2num(gs)
data = zeros(nbb,12);
edit=true(1:nbb);
colnames = {'BUS NO', 'BUS CODE','VOLTAGE MAG.','ANGLE DEG.','LOAD(MW)','LOAD(MVAR)','GEN(MW)','GEN(MVAR)', 'GEN Qmin','GEN Qmax','SHUNT RES.','SHUNT REAC'};
t1 = uitable('Data', data, 'ColumnName', colnames, 'ColumnEditable',edit, ...
'Position', [100 240 720 100])
linedata = zeros(ntl,6);
editbir=true(1:ntl);
colnames = {'SEND', 'RECEIVE','RESIS','REAC','COND','SUSCEP'};
t2 = uitable('Data', linedata, 'ColumnName', colnames, 'ColumnEditable',editbir, ...
'Position', [100 100 500 100]);
采纳的回答
更多回答(2 个)
Walter Roberson
2011-4-3
data1 = get(t1,'Value');
Then use cell array indexing to access the elements.
类别
在 帮助中心 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!