MATLAB Answers

how to solve the problem of "out of memory"?

2 views (last 30 days)
muhammad ismat
muhammad ismat on 5 Apr 2018
i have the following code to calculate matrix s
for i = 1:n
for j = 1:i % <-- Note the 1:i instead of 1:n
s(i,j) = (DL(i,IDX(j))*DL(j,IDX(i))) / norm(DL(i,IDX(j))) * norm(DL(j,IDX(i)));
s(j,i) = s(i,j);
where the input for this code is matrix (5000 x 5000) i.e i= 1:5000 and also j, and each time calculate s(i,j) from mentioned equation that depend on DL (vector 5000 x 2), but when i run this code the program give me error " out of memory"

Answers (0)

Community Treasure Hunt

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

Start Hunting!