How can I replace every element of a matrix with a special character to hide the element
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a nxn matrix and want to hide the elements and replace them with a special character
Example
1 2 3
4 5 6
7 8 9
is now
* * *
* * *
* * *
채택된 답변
추가 답변 (2개)
Image Analyst
2015년 11월 27일
Try this, using fprintf():
m = [...
1 2 3
4 5 6
7 8 9]
[rows, columns] = size(m);
for row = 1 : rows
for col = 1 : columns
fprintf('* ');
end
fprintf('\n');
end
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!