To create an array and fill it with the same number in MATLAB, you can use the repmat
function.
Here is an example of creating an array of size [3, 3]
and filling it with the number 5
:
main.m85 chars3 lines
This will create an array array
with dimensions 3x3
and all elements will be filled with the value 5
.
You can change the size of the array and the number you want to fill it with according to your requirements.
gistlibby LogSnag