Products & Services Solutions Academia Support User Community Company

Learn more about Model-Based Calibration   

RollbackEdit - Undo most recent changes to data

Syntax

D = RollbackEdit(D)

Description

This is a method of mbcmodel.data. Use this if you change your mind about changes you have made to the data since you called BeginEdit, such as importing or appending data, applying filters or creating new user variables.

There are no input arguments. If for your data object D, IsBeingEdited is true, then RollbackEdit will return it to the same state as it was when BeginEdit was called. If IsEditable(D) is true then you can still modify it, if not it will revert to being read-only. See the example below.

Examples

D = P.Data;
BeginEdit(D);
AddVariable(D, 'TQ = tq', 'lbft');
AddFilter(D, 'TQ < 200');
DefineTestGroups(D, {'RPM' 'AFR'}, [50 10], 'MyLogNo');
RollbackEdit(D);

This returns the data object D to the same state as when BeginEdit was called. If the data object IsEditable then the returned object will still return true for IsBeingEdited, else it will not be editable.

For an example case where IsEditable is false and IsBeingEdited is true:

D = p.Data;
D1 = p.Data;
BeginEdit(D1);
tp = p.Testplan;
Attach(tp, D);

Where p is an mbcmodel.project object, and D and D1 are mbcmodel.data objects.

At this point IsEditable for D1 becomes false because it is now Attached to the test plan and hence can only be modified from the test plan. However

OK = D1.IsBeingEdited

will still be true at this point, and trying to call CommitEdit will fail.

See Also

BeginEdit, CommitEdit, IsBeingEdited

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS