如何解决警告:表数据在此位置不可编辑
我只有在第一次运行时才有一个工作 GUI,但是由于某种原因,在第二次或另一次运行中它不允许我编辑 uitable 并抛出错误“警告:表数据在此位置不可编辑“我可能在更新表格方面搞砸了。请帮帮我
function pushbutton1_Callback(hObject,eventdata,handles)
x = get(handles.uitable1,'data')
y = str2double(x(:,1))'
TotalMass = get(handles.TotalMass,'String');
CoarseMass = get(handles.CoarseMass,'String');
FineMass = get(handles.FineMass,'String');
TotalMass = str2num(TotalMass);
CoarseMass = str2num(CoarseMass);
FineMass = str2num(FineMass);%
global Data
Data = [y;(y/TotalMass)*100;cumsum((y/TotalMass)*100);100-cumsum((y/TotalMass)*100)]';
set(handles.uitable1,'Data',Data)
function TotalMass_Callback(hObject,handles)
函数 TotalMass_CreateFcn(hObject,handles)
if ispc && isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function FineMass_Callback(hObject,handles)
% --- 在对象创建期间执行,在设置所有属性之后。 function FineMass_CreateFcn(hObject,'white'); end
function pushbutton2_Callback(hObject,handles)
ParticleSize = [100 80 40 20 10 4.75 2 1 .6 .425 .3 .212 .150 .075 0.037]';
global Data
n = Data;
semilogx(handles.axes1,ParticleSize,n(:,4),'Linew',2)
D30 = ParticleSize(dsearchn(n(:,30));
D60 = ParticleSize(dsearchn(n(:,60));
D10 = ParticleSize(dsearchn(n(:,10));
global Cc
global Cu
Cc = D30^2/(D60*D10);
Cu =D60/D10;
set(handles.axes1,'Xdir','reverse')
xlabel(handles.axes1,'Sieve Size')
ylabel(handles.axes1,'Percentage Finer %')
if Cc > 1 & Cc < 3 & Cu > 4 & Cu < 6
set(handles.soilclass,'String',["Well graded soil with a Cc= " Cc " and Cu = " Cu])
else
set(handles.soilclass,["Poorly graded soil with a Cc= " Cc " and Cu = " Cu])
end
grid on
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。