MATLAB: How to replace every element of a matrix with a special character to hide the element

hide matrix

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
* * *
* * *
* * *

Best Answer

x = magic(3);
y = repmat('*',size(x));
disp(y);