Adding a variable to a square zeros matrix given x and y coordinates calculated from separate vectors
이전 댓글 표시
Ive got two vectors made of 0s and one possible 1, ive calculated the positions of the said 1 as
classpos=find(classlabels==1); %X Coordinate position retating to class labels
truepos=find(truelabels==1); %Y Coordinate position relating to true labels
M=zeros(10,10); %10x10 Zeros matrix creation
how do I place a 1 in the positions i've calculated and do this cumulatively as this will appear in a for loop for repetitively adding 1s to this square matrix given their coordinates in two independent vectors. Thank you for your time, Jacob
댓글 수: 2
James Tursa
2018년 3월 20일
What is M and how is it related to your "coordinates"? Are you setting an M element to 1, or cumulatively adding 1 to appropriate M elements? Can you show us your for-loop code?
Jacob Ainsworth
2018년 3월 20일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!