Store values from a for loop into a matrix

조회 수: 4 (최근 30일)
Jo E.
Jo E. 2019년 9월 22일
편집: Jo E. 2019년 9월 22일
Hello all, if anyone could possibly help me I would greatly appreciate it. I am attempting to store values calculated in a for loop in a matrix. I have already tried to preallocate arrays and create an empty matrix but just cant seem to get it to work.
The matrix would be [65x3] because there are 3 conditions and 65 participants. The for loop calculates one condition from one participant at a time.
for RARs = zeros(65, 3)
i = 1:65;
RARatio = AUC/RA;
disp(RARatio)
% RAR Matrix
RARmat(RARs, :) = RARatio;
end
Thank you in advance!

채택된 답변

madhan ravi
madhan ravi 2019년 9월 22일
RARmat = zeros(65, 3)
for ii = 1:65
RARatio = AUC/RA;
disp(RARatio)
% RAR Matrix
RARmat(ii, :) = RARatio;
end
  댓글 수: 11
madhan ravi
madhan ravi 2019년 9월 22일
You would be better off starting a new question (also link this thread to that question), so that you get a help soon.
Jo E.
Jo E. 2019년 9월 22일
Will do. Thank you for your help.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by