GUI - output in uitable

1 次查看(过去 30 天)
aixat amxan
aixat amxan 2015-6-9
can someone help me to correct the coding below,
clc
format long g
T=str2num(get(handles.edit4,'String'));
table=get(handles.uitable1,'Data');
X=table(:,1);
Y=table(:,2);
Z=table(:,3);
Lat1=(X-0);
Long1=(Y-0)
HS=(T-(Z));
set(handles.uitable3,'String',Lat1,Long2,HS); <-- coding for this line have problem to store output in uitable.

回答(1 个)

Walter Roberson
Walter Roberson 2015-6-9
T = str2num(get(handles.edit4,'String'));
table = cell2mat(get(handles.uitable1,'Data'));
X=table(:,1);
Y=table(:,2);
Z=table(:,3);
Lat1=(X-0);
Long1=(Y-0)
HS=(T-(Z));
set(handles.uitable3,'Data', num2cell([Lat1,Long2,HS]) );
  3 个评论
aixat amxan
aixat amxan 2015-6-9
编辑:Walter Roberson 2015-6-9
thanks sir, i get the answer by:
T=str2num(get(handles.edit4,'String'));
table=get(handles.uitable1,'Data');
X=table(:,1);
Y=table(:,2);
Z=table(:,3);
Lat1=(X-0);
Long1=(Y-0)
HS=(T-(Z));
K=[Lat1,Long1,HS];
set(handles.uitable3,'Data',K);
Walter Roberson
Walter Roberson 2015-6-9
T = str2num(get(handles.edit4,'String'));
table = get(handles.uitable1,'Data');
if iscell(table); table = cell2mat(table); end
X=table(:,1);
Y=table(:,2);
Z=table(:,3);
Lat1=(X-0);
Long1=(Y-0)
HS=(T-(Z));
set(handles.uitable3,'Data', [Lat1,Long1,HS] );

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Mapping Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by