Iteration cycle of a code

7 ビュー (過去 30 日間)
Ricardo Gutierrez
Ricardo Gutierrez 2019 年 12 月 4 日
コメント済み: Ricardo Gutierrez 2019 年 12 月 5 日
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,….];
instructions
instructions
instructions
instructions
instructions
instructions
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
  6 件のコメント
Adam Danz
Adam Danz 2019 年 12 月 5 日
編集済み: Adam Danz 2019 年 12 月 5 日
" I want to update the values of A with the resulting matrix B"
So you want to completely overwrite A with whatever is stored in B on each iteration.
But this I have not been able to achieve"
Why not? What specific problems have you faced?
Again, a simple example of expected input and outputs usually saves quite a bit of time and dialog.
Ricardo Gutierrez
Ricardo Gutierrez 2019 年 12 月 5 日
You are right.
I should check my code.
Thank you very much for your patience and your help.

サインインしてコメントする。

採用された回答

meghannmarie
meghannmarie 2019 年 12 月 5 日
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;
end
  5 件のコメント
meghannmarie
meghannmarie 2019 年 12 月 5 日
Is variable A part of the input into building variable B? There must be an error in your code, I do not know how to troubleshoot without code.
Ricardo Gutierrez
Ricardo Gutierrez 2019 年 12 月 5 日
Thank you very much.
You are right there must be some error in my code.
Thank you for your patience and attention.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

製品


リリース

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by