How to run cell array from 1 to max_iter?

max_iter = 100
V_cell = cell(max_iter, 1);
V_cell{1} = V;
for i = 1:max_iter
nrow = size(data,1);
nbar = size(V_cell{i}, 1);
out = zeros(nbar, nrow);
for k = 1:nbar
out(k,:) = sqrt(sum(((data-ones(size(data, 1), 1)*V_cell{i}(k,:)).^2), 2));
end
dist = out; % fill the distance matrix
I've done this, but the result dist contains all NaN, can you give me some solution? Thanks.

댓글 수: 2

Bhaskar R
Bhaskar R 2019년 12월 8일
Can you provide data ?
Day7
Day7 2019년 12월 9일
Yes, actually if i replace V_cell{i} with V_cell{1} it worked.

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

답변 (1개)

Hiro Yoshino
Hiro Yoshino 2019년 12월 9일

0 개 추천

Remember:
cell(1) --> 1st cell as a cell-type
cell{1} --> the content of the 1st cell as a number, string, ... whatever

댓글 수: 1

Day7
Day7 2019년 12월 27일
i already change it but it still didn't work

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

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품

릴리스

R2019a

질문:

2019년 12월 8일

댓글:

2019년 12월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by