Well, unless I completely misunderstood your question:
x_constraint = yourstructure.X;
y_constraint = yourstructure.Y;
However, there is no benefit to that. Why not use yourstructure.X whenever you want x_constraint and not bother creating x_constraint in the first place?
2 Comments
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/305493-how-to-separate-the-field-from-a-structure-in-matlab#comment_395499
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/305493-how-to-separate-the-field-from-a-structure-in-matlab#comment_395499
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/305493-how-to-separate-the-field-from-a-structure-in-matlab#comment_1017190
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/305493-how-to-separate-the-field-from-a-structure-in-matlab#comment_1017190
Sign in to comment.