size() function returns wrong size
이전 댓글 표시
i have the following line of code:
s = size(k_distances)
k_distances is a 1x1 matrix:

but the size function returns a size of 1x2:

and then:
k_labels = zeros(s);
returns a 3x1 matrix that not all zeros!!

any idea what is happening?
thank you
댓글 수: 4
VBBV
2020년 11월 7일
May be k_distances variable is called inside another loop and its size is varying. Can you show full code ?
John D'Errico
2020년 11월 7일
Please don't post pictures of your code. You can paste in text more easily, and that text can now be copied by those who would try to help you.
danielle sisserman
2020년 11월 7일
danielle sisserman
2020년 11월 7일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!