Deleting a field from a sturcture

조회 수: 7 (최근 30일)
Shaun VanWeelden
Shaun VanWeelden 2012년 12월 29일
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?

채택된 답변

Brian B
Brian B 2012년 12월 29일
Did you save the results of rmfield back to myStruct?
myStruct = rmfield(myStruct, myField)
Brian
  댓글 수: 3
Image Analyst
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.
Shaun VanWeelden
Shaun VanWeelden 2012년 12월 29일
I know, I think I'm just not to use to working with the structures, which by the way are pretty awesome and perfect for the project I'm doing.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by