rmfield_snn.m
来自「神经网络的工具箱, 神经网络的工具箱,」· M 代码 · 共 21 行
M
21 行
function t = rmfield_snn(s, field)%RMFIELD_SNN Remove field from structure.%% new_struct = rmfield_snn(old_struct, field_to_remove)%if ~isa(s,'struct'), error('S must be a structure array.'); endif ~isstr(field), error('field must be string.'); endfirstpoint = min(find(field == '.'));if isempty(firstpoint) t = rmfield(s, field); else field_head = field(1:(firstpoint-1)); field_sub = field(firstpoint+1:size(field,2)); s_sub = getfield(s, field_head); t = rmfield(s, field_head); t = subsasgn(t, substruct('.', field_head), rmfield_snn(s_sub, field_sub));end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?