📄 setr.m
字号:
function M = setr(recordvar, fieldname, fieldvar)% RECVAR, A package for new data types in Matlab 4. % (c) FOA 1997. See the file rvright.m for copyright notice.%% function M = setr(recordvar, fieldname, fieldvar)%% Creates record variables and creates and changes the contents of fields.% Matlab 5 compatibility version.%% M RecVarT% recordvar RecVarT or []% fieldname StringT% fieldvar Any type%% Ex:% A = setr(A, 'frequency', 2800); % % Sets the field 'frequency' to the value 2800 in the record variable 'A'.%% If 'recordvar' is not an record variable an error message is issued.% To create a new record variable use 'recordvar' = [].% Start : 970820 Svante Bj鰎klund (svabj).% Latest change: $Date: 1997/12/08 15:49:45 $ $Author: svabj $.% $Revision: 1.2 $% *****************************************************************************%M = matvar('setr', recordvar, fieldname, fieldvar);if (isstruct(recordvar) | isempty(recordvar)) M = setfield(recordvar, fieldname, fieldvar);else error('Can not change a matrix, which is not a record variable.') % Note, Matlab can do this but RECVAR with Matlab 4 can not.end%if
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -