| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → SimMechanics |
| Contents | Index |
| Learn more about SimMechanics |
dststates = mech_transfer_states(srcMgr, dstMgr, transferstruct)
dststates = mech_transfer_states(srcMgr, dstMgr, transferstruct,
srcstates)
dststates = mech_transfer_states(srcMgr, dstMgr, transferstruct,
srcstates, dststates)
dststates = mech_transfer_states(srcMgr, dstMgr, transferstruct) copies selected state entries from the source state vector manager srcMgr to the state vector dststates, which can be assigned to dstMgr.X, where dstMgr is the state vector manager for the destination machine. The states to be copied are specified in transferstruct. Any destination states not specified in transferstruct retain their values as specified initially in dstMgr.
dststates = mech_transfer_states(srcMgr, dstMgr, transferstruct, srcstates) performs the same transfer, but takes the "source" states in srcstates rather than the values in srcMgr.X.
dststates = mech_transfer_states(srcMgr, dstMgr, transferstruct, srcstates, dststates) performs the same transfer, but also takes the "destination" states in dststates rather than the values in dstMgr.X for those destination states that are not the target of an assignment.
mech_transfer_states accepts three, four, or five inputs.
srcMgr |
A state vector manager for the source system. It is an object of the MECH.StateVectorMgr class as returned by the mech_stateVectorMgr function. This input is required. |
dstMgr |
A state vector manager for the destination system. It is an object of the MECH.StateVectorMgr class as returned by the mech_stateVectorMgr function. This input is required. |
transferstruct |
A structured array whose src and dst fields contain either the indices or the names of the source and destination states as known to their respective state managers. This input is required. Either or both of the dst and src fields in transferstruct can also be indices for their respective vector manager's X vectors. |
srcstates |
A source mechanical state vector. This input is optional. |
dststates |
A destination mechanical state vector. This input is optional and requires the optional fourth input. |
dststates |
The destination mechanical state vector. |
Copy the first state in srcMgr to the third state in dstMgr:
transferstruct(1).src=srcMgr.StateNames{1};
transferstruct(1).dst=dstMgr.StateNames{3};
dstMgr.X = mech_transfer_states(srcMgr, dstMgr, transferstruct);
Define the same transferstruct structure as in the preceding example.
If both of the dst and src fields in transferstruct are indices for their respective vector manager's X vectors, this function is equivalent to:
dststates(transferstruct.dst) = srcstates(transferstruct.src)
mech_get_states | mech_runtime_states | mech_set_states | mech_stateVectorMgr | sim | states
![]() | mech_stateVectorMgr | Configuration Parameters | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |