create a matrix with only pi and size 3x3 in matlab

To create a 3x3 matrix containing only pi in MATLAB, you can use the following code:

main.m
A = repmat(pi, 3, 3)
21 chars
2 lines

This code uses the repmat function to repeat the element pi 3 times in each dimension, producing a 3x3 matrix filled entirely with pi.

gistlibby LogSnag