Asked by Jo E.
on 22 Sep 2019

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!

Answer by madhan ravi
on 22 Sep 2019

Accepted Answer

RARmat = zeros(65, 3)

for ii = 1:65

RARatio = AUC/RA;

disp(RARatio)

% RAR Matrix

RARmat(ii, :) = RARatio;

end

Jo E.
on 22 Sep 2019

madhan ravi
on 22 Sep 2019

Jo E.
on 22 Sep 2019

Will do. Thank you for your help.

Sign in to comment.

Opportunities for recent engineering grads.

Apply Today
## 0 Comments

Sign in to comment.