temp = get(handles.input1,'string');
inputs{1} = [];
if strcmp(temp ,'-') == 0
inputs{1} = str2double(temp);
end
temp = get(handles.input2,'string');
if strcmp(temp ,'-') == 0
inputs{2} = str2double(temp);
end
temp = get(handles.input3,'string');
if strcmp(temp ,'-') == 0
inputs{3} = str2double(temp);
end
temp = get(handles.input4,'string');
if strcmp(temp ,'-') == 0
inputs{4} = str2double(temp);
end
temp = get(handles.input5,'string');
if strcmp(temp ,'-') == 0
inputs{5} = str2double(temp);
end
temp = get(handles.input6,'string');
if strcmp(temp ,'-') == 0
inputs{6} = str2double(temp);
end
matlab 读取参数,不同策略不同参数个数
最新推荐文章于 2023-10-29 23:00:57 发布
本文介绍了一种在MATLAB GUI中处理多个输入框的方法。通过检查每个输入框的内容,如果内容不是默认值'-',则将其转换为数值类型进行后续处理。这种方法确保了只有当用户输入有效数据时才进行转换。
3006

被折叠的 条评论
为什么被折叠?



