Mercurial > octave-nkf
comparison scripts/miscellaneous/orderfields.m @ 16656:cf84ea2ba2d3
require dynamic field names to be character strings
* pt-idx.cc (tree_index_expression::get_struct_index):
Require field names to be character strings.
* orderfields.m: Index fieldnames with {} instead of ().
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 13 May 2013 18:50:14 -0400 |
parents | 6be613476e37 |
children | 83e6baf0bc3f |
comparison
equal
deleted
inserted
replaced
16655:8fa0b416f465 | 16656:cf84ea2ba2d3 |
---|---|
151 args(2:2:end) = {[]}; | 151 args(2:2:end) = {[]}; |
152 t = struct (args{:}); | 152 t = struct (args{:}); |
153 else | 153 else |
154 n = numel (s1); | 154 n = numel (s1); |
155 for i = 1:numel (names) | 155 for i = 1:numel (names) |
156 el = names(i); | 156 el = names{i}; |
157 [t(1:n).(el)] = s1(:).(el); | 157 [t(1:n).(el)] = s1(:).(el); |
158 endfor | 158 endfor |
159 ## inherit dimensions | 159 ## inherit dimensions |
160 t = reshape (t, size (s1)); | 160 t = reshape (t, size (s1)); |
161 endif | 161 endif |