Iteration cycle of a code

3 views (last 30 days)
Hi !!! Have a nice day.
I have a code that starts with the generation of a matrix A,
after a numerical process at the end I have a matrix B
A = [a, b, c,… ..
q, w, r,….];
B = [d, e, f,….
and, u, I, ...];
At the end of the numerical process I have matrix B, immediately
the values of B are assigned to A in this way
A = B
What instruction I need to do to generate this cycle N times, that this; the results of B introduce them to input A?
I hope you understand what I want to do
Thank you
Ricardo Gutierrez
Ricardo Gutierrez on 5 Dec 2019
You are right.
I should check my code.
Thank you very much for your patience and your help.

Sign in to comment.

Accepted Answer

meghannmarie on 5 Dec 2019
Can you show your code? Make sure you are initally setting A before the for loop. If I am understanding the problem, it should look something like this:
A = [a,b,c;q,w,r];
for n = 1:5
% instructions
% instructions
% instructions
B = [d,e,f;l,m,n]
A = B;
Ricardo Gutierrez
Ricardo Gutierrez on 5 Dec 2019
Thank you very much.
You are right there must be some error in my code.
Thank you for your patience and attention.

Sign in to comment.

More Answers (0)


Find more on Resizing and Reshaping Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by