Answered! I want to use the command fprintf to show a random 5 by 6 matrix using MATLAB Without inputting %f five times…

I want to use the command fprintf to show a random 5 by 6 matrix using MATLAB
Without inputting %f five times
And without using a for loop

I tried to do
Mat = rand(5,6)
fprintf(‘%ft,’ mat)
fprintf(‘n’)

But that puts each number in one line i want to show 5 numbers then drop a line then 5 numbers … etc.

Expert Answer

 Here is the matlab code

fprintf([repmat(‘%ft’, 1, size(Mat, 2)) ‘n’], Mat’);

It will put tab t space between values in a row and new line between rows

Still stressed from student homework?
Get quality assistance from academic writers!