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.
When I run the test suite on my computer, this solution works. It passes the test suite.
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')
10135 Solvers
Find the two most distant points
1645 Solvers
How to find the position of an element in a vector without using the find function
2482 Solvers
281 Solvers
Find out missing number from a vector of 9 elements
247 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!