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
Walter Roberson
2015년 11월 14일
What is the error message?
채택된 답변
추가 답변 (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!