how should i put the data in gui uitable
显示 更早的评论
hey, i am beginer in GUI and i have written this code in gui which i used 2 uitable and in first one the user should enter all data for columns number 1 and 3 and just first cell of columns 2, 10 and 11 and put sum of spitial culomns in uitable 2. but i have evaluating eror in this push buttom. thank for help.
data = get(handles.ut1,'Data');
A = data(:,1);
[m n]=size(A);
G = zeros(m,n);
G(1) = data (1,2);
for i=2:m
G(i)=G(i-1)+A(i-1)-180;
if G(i)>360
G(i)=G(i)-360;
elseif G(i)<0
G(i)=G(i)+360;
end
end
d = data(:,3);
deltax = zeros(m,n) ;
deltay = zeros(m,n) ;
cx=zeros(m,n) ;
cy=zeros(m,n) ;
deltaxc = zeros(m,n) ;
deltayc = zeros(m,n) ;
for i = 1:m ;
G(i)=G(i)*(pi/180);
deltax(i)=d(i)*sin(G(i));
deltay(i)=d(i)*cos(G(i));
cx(i)=(-d(i))*(sum(deltax)/sum(d));
cy(i)=(-d(i))*(sum(deltay)/sum(d));
deltaxc(i)=deltax(i)+cx(i);
deltayc(i)=deltay(i)+cy(i);
end
x=zeros(m,n);
y=zeros(m,n);
x(1) = data (1,10);
y(1) = data (1,11);
for i=2:m;
x(i)= x(i-1)+deltaxc(i-1);
y(i)= y(i-1)+deltayc(i-1);
end
res = [A, G ,d, deltax, deltay, cx ,cy, deltaxc, deltayc ,x, y];
set(handles.ut1,'Data',res)
采纳的回答
更多回答(1 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!