Develop a reordering matrix based on stored vectors

2 vues (au cours des 30 derniers jours)
Aaron DeSantis
Aaron DeSantis le 23 Fév 2023
Réponse apportée : Voss le 23 Fév 2023
I would like to make a reordering matrix to remap values in a matrix. This is a tool used in the determination of gobal stiffness matrices for trusses, beams, frames, etc. We start with two vectors defined as order_old and order_new.
order_old = [1 2 3 4 5 6];
order_new = [4 5 1 2 3 6];
Then arrange them along side a blank 6x6 matrix placing 1's where indecies match and 0's where they do not. See the image below for clarification.
This matrix will then be used to reorder a stiffness matrix in one corrderinate system (old order) to the new coordinate system (new order). Is there a way to make the matrix "output" as shown in the figure above in matlab?

Réponse acceptée

Voss
Voss le 23 Fév 2023
order_old = [1 2 3 4 5 6];
order_new = [4 5 1 2 3 6];
Output = order_old.' == order_new

Plus de réponses (0)

Catégories

En savoir plus sur Structural Analysis dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by