replace initial matrix with a new one on Simulink

hi, I have this problem: I am making a simulink program for attitude determination, in the first step I use an initial matrix to calculate the rotation of my vector, after this I use the vector to calculate a new matrix, now I would like to repeat the same procedure but use the new matrix found to replace the initial one and so on for the following steps. how can I do?

1 comentario

And Cav
And Cav el 13 de Nov. de 2022
What I have is that: I start with a vector v and a matrix A0 and I compute s=A0*v, then I use s to find another matrix A1. Now I wanto ti find the new vector s using A1 instead of A0: s=A1*v. Then find A2 and use it: s=A2*v and so on. How can I do with Simulink?

Iniciar sesión para comentar.

Respuestas (1)

Fangjun Jiang
Fangjun Jiang el 14 de Nov. de 2022
All you need is a "Product" block and a "Unit Delay" block. Use the "Unit Delay" block to get the value of s from previous step.

7 comentarios

And Cav
And Cav el 14 de Nov. de 2022
I’ll try. Thank you very much.
And Cav
And Cav el 14 de Nov. de 2022
Howevar, the value of s has to change at any step, what I wnat to do is to create a loop in which I substitute the value of A I’ve computed at the previous step to evaluate the new value of s. There’s no integration. I don’t know how to change the A at any step: s1=A1*v, then s=A2*v, s3=A3*v,… I use a product block but I don’t know how to change the input A at any step.
Use the "From Workspace" block to import the pre-defined A value at any time. Read the Help document of the block. There is a particular format that you meed to construct.
And Cav
And Cav el 15 de Nov. de 2022
Thank you. I knew this block, however I don’t know how to use it for my problem
Look at this link or your local help document. There is an example for reading in 2-D matrix signal.
And Cav
And Cav el 15 de Nov. de 2022
Thank you. I’ll look at it.
And Cav
And Cav el 16 de Nov. de 2022
I’m trying to use the goto block, I’ve created a Matlab function (with the matlab function block) which sets A=A0 for t=0 and uses the goto matrix for t>0. However it doesn’t work. Do you know why?

Iniciar sesión para comentar.

Categorías

Etiquetas

Preguntada:

el 13 de Nov. de 2022

Comentada:

el 16 de Nov. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by