📄 listhelp.m
字号:
% *****************************************************************************% RECVAR, A package for new data types in Matlab. % (c) FOA 1998. See the file rvright.m for copyright notice.%% Lists in RECVAR% ---------------%% Management of lists.%% The lists can contain arbitrary data types (except sparse matrices) % as elements.%% Examples:%% >> l1 = put1stl(5,[]);% >> l1 = put1stl(6,l1);% >> showl(l1)%% 6% 5%% >> l = makelist([1 2; 3 4], 5, 'hallo');% >> l = appendl(l,4);% >> showl(l)%% [1 2; 3 4]% 5% hallo% 4%% >> a = setr([],'name','Tom');% >> a = setr(a,'age',43);% >> b = setr([],'name','Julia');% >> b = setr(b,'age',39);% >> MM = zerosm([2 2 2]);% >> MM = setm(MM,[1 2; 3 4], 1:2, ':', 1);% >> MM = setm(MM,[5 6; 7 8], ':', ':', 2);% >> register = setr([],'Type','Personel register');% >> personlist = makelist(a,b);% >> register = setr(register,'persons',personlist);% % >> l5 = makelist('hallo', [1 2; 3 4], [1; 2.5 + 3.75*i],a ,MM ,register);% >> dispr(l5)% % ...%%%% The following functions are currently implemented:% makelist : Creates a list.% put1stl : Put an element first in the list. Can also create a list.% appendl : Appends an element last in the list.% get1stl : Gets the first element of a list.% getrestl : Returns a list with the first element removed.% islastl : Returns true if a list contains only one element.% islist : Returns true if the input parameter is a list.% reversel : Reverses the elements of a list.% showl : Shows the contents av all elements in a list on the screen.% list2rec : Converts a list to a record variable (Matlab 5 only).%% There is also new function "dispr" for the display the contents of a % variable on the screen. This function handles ordinary Matlab variables, % record variables, multidimensional matrices and lists.%% As an example of the use of list functions, the code for showl is below.:% function showl(list)% while (~islastl(list))% disp(get1stl(list))% list = getrestl(list);% end%while% disp(get1stl(list))%%Matlab 4:%---------% There are the same restrictions on the allowed operations on a list as% on a record variable, since lists are implemented using record % variables. See help recvar.%%Matlab 5:%---------% Lists are implemented using Matlab 5's cell arrays, se reference [1].%%References:% [1] "Using Matlab Version 5", The MathWorks, Inc., 1997. % *****************************************************************************% Start : 970820 Svante Bj鰎klund (svabj).% Latest change: $Date: 1998/05/12 10:42:05 $ $Author: svabj $.% $Revision: 2.5 $% *****************************************************************************help listhelp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -