Deleting a field from a sturcture
5 次查看(过去 30 天)
显示 更早的评论
I have been trying to delete a field from a structure, but it keeps coming back!
I do rmfield(myStruct,myField) and it shows all the fields that strucuture has and its not on that one, but then I go look at an individual item and its back, and then I go back and look at the structure and its back there too, I am so lost. It looks like its gone, and then poof, its back. Its like herpes.
Any suggestions?
0 个评论
采纳的回答
Brian B
2012-12-29
Did you save the results of rmfield back to myStruct?
myStruct = rmfield(myStruct, myField)
Brian
3 个评论
Image Analyst
2012-12-29
Understandable. That would have worked in some languages, ones that have pass by reference, but MATLAB is pass by value.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!