Problem 86. Renaming a field in a structure array
Solution Stats
Problem Comments
-
2 Comments
Does "All the data still" mean, that the fields are not re-ordered? A lot of the solutions change the order of the fields.
Currently, Matlab has the function renameStructField.
Solution Comments
-
1 Comment
When I run the test suite on my computer, this solution works. It passes the test suite.
-
1 Comment
This fails, if the fieldname to be replaced appears as part of another fieldname. Example: S.ab=1; S.a=2; renamefield(S, 'a', 'c')
Problem Recent Solvers1176
Suggested Problems
-
Back to basics 8 - Matrix Diagonals
881 Solvers
-
Construct an index vector from two input vectors in vectorized fashion
341 Solvers
-
We love vectorized solutions. Problem 1 : remove the row average.
751 Solvers
-
Create an index-powered vector
544 Solvers
-
Find the Oldest Person in a Room
12448 Solvers
More from this Author96
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!