How can I replace every element of a matrix with a special character to hide the element
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sahil Bajaj
am 26 Nov. 2015
Beantwortet: Rick Rosson
am 29 Nov. 2015
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
* * *
* * *
* * *
1 Kommentar
Akzeptierte Antwort
Weitere Antworten (2)
Image Analyst
am 27 Nov. 2015
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 Kommentare
Siehe auch
Kategorien
Mehr zu Matrix Operations and Transformations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!