rbmatlab
1.13.10
Main Page
Related Pages
Modules
Packages
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Groups
Pages
general
basic
structcpy.m
Go to the documentation of this file.
1
function
[s1] =
structcpy
(s1,s2)
2
%
function
[s1] =
structcpy
(s1,s2)
3
% copies the fields of structure s2 into structure s1. If the field to be
4
% copied does not exist in s1 yet, a field with the appropriate name is
5
% created.
6
%
7
8
% Martin Drohmann, 01.09.2009
9
10
f2 = fieldnames(s2);
11
for
i = 1:length(f2)
12
s1.(f2{i}) = s2.(f2{i});
13
end
14
Generated on Mon Oct 14 2013 08:51:33 for rbmatlab by
1.8.2-20120930