Mercurial > hg > ltpda
comparison m-toolbox/classes/@ltpda_uo/fromStruct.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 % FROMSTRUCT sets all properties which are defined in the ltpda_uo class from the structure to the input object. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % FUNCTION: fromStruct | |
5 % | |
6 % DESCRIPTION: Sets all properties which are defined in the ltpda_uo class | |
7 % from the structure to the input object. | |
8 % | |
9 % REMARK: Abstract classes handle only one input object and a | |
10 % structure with the size 1. | |
11 % | |
12 % CALL: obj = fromStruct(obj, struct) | |
13 % | |
14 % VERSION: $Id: fromStruct.m,v 1.1 2010/12/20 20:41:40 ingo Exp $ | |
15 % | |
16 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
17 | |
18 function obj = fromStruct(obj, obj_struct) | |
19 | |
20 % Call super-class | |
21 obj = fromStruct@ltpda_obj(obj, obj_struct); | |
22 | |
23 % Set 'name' object | |
24 if isfield(obj_struct, 'name') | |
25 obj.name = obj_struct.name; | |
26 end | |
27 | |
28 % Set 'description' object | |
29 if isfield(obj_struct, 'description') | |
30 obj.description = obj_struct.description; | |
31 end | |
32 | |
33 % Set 'mdlfile' object | |
34 if isfield(obj_struct, 'mdlfile') | |
35 obj.mdlfile = obj_struct.mdlfile; | |
36 end | |
37 | |
38 % Set 'UUID' object | |
39 if isfield(obj_struct, 'UUID') | |
40 obj.UUID = obj_struct.UUID; | |
41 end | |
42 | |
43 end |