Create a nested struct to store a persons name address and t
Create a nested struct to store a persons name, address, and telephone number. The struct should have three fields for the name, address, and telephone number. The address fields and telephone number fields will be structs.In Matlab!
Solution
The syntax to define structure in matlab is
s= struct(field,value)
where field is the attribute name and value is the value to that fields
s = struct(\'a\',{},\'b\',{},\'c\',{}) which is when value are not provided.
and syntacx for nested struc is a.b = (\'c\',{}) this means b is field to a and b is struct itself.
Hence with the given scenario the defintion is
person.address.telephonenumer = struct(\'personname\',{})
