www.gusucode.com > mbcdesign 工具箱 matlab 源码程序 > mbcdesign/@designdev/private/DesignDev2Cell.m

    function arrayobj = DesignDev2Cell(obj)
%DESIGNDEV2CELL

%  Copyright 2000-2008 The MathWorks, Inc. and Ford Global Technologies, Inc.



if ~isa(obj,'designdev')
	error(message('mbc:designdev:InvalidArgument8'));
end

% How many array objects do we have?
cnt = count(obj);
% Preallocate the storage space
arrayobj = cell(1,cnt);

% Inverse direction to make objarray compatible with DesignDev indexing
for i = cnt:-1:1
	% Get next object
	next = obj.next;
	% Set next object empty to save space
	obj.next = [];
	% Place object in array
	arrayobj{i} = obj;
	% Get ready for next object
	obj = next;
end