Mercurial > hg > ltpda
comparison m-toolbox/classes/+utils/@helper/getObjectFromStruct.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 | |
2 | |
3 function obj = getObjectFromStruct(obj_struct) | |
4 | |
5 if isa(obj_struct, 'ltpda_obj') | |
6 obj = obj_struct; | |
7 else | |
8 objCl = utils.helper.getClassFromStruct(obj_struct); | |
9 if ~isempty(objCl) | |
10 % Call constructor of the data class | |
11 obj = feval(objCl, obj_struct); | |
12 else | |
13 obj = obj_struct; | |
14 end | |
15 end | |
16 | |
17 end |