I am currently working on a project for school. I need to display a matrix using disp() or fprintf(). Everytime I display using disp() the code comes up like this
1.0e+07 * 0.0000 0.0000 0.0000 0.0000 2.9000 0.0000 0.0002 0.0045 0.0000 0.0000 0 0.0000 2.9000 0.0005 0.0000 0.0045 0.0000 0.0000 0.0000 0.0000 2.6000 0.0000 0.0000 0.0061 0.0000 0.0000 0.0000 0.0000 0.1100 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 2.9000 0.0000 0.0000 0.0045 0.0000 0.0000 0.0000 0.0000 1.6000 0.0000 0.0000 0.0024 0.0000 0.0000 0 0.0000 1.6000 0.0000 0.0000 0.0037 0.0000 0.0000 0.0000 0.0000 -1.6000 0.0000 0.0000 0.0037 0.0000 0.0000 0.0000 0.0000 0.1100 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 2.9000 0.0004 0.0000 0.0045 0.0000 0.0000 0.0000 0.0000 2.9000 0.0006 0.0000 0.0045
I tried format longg but then it shows up like this
Columns 1 through 6 1 1 2 3 29000000 10 2 3 0 4 29000000 5000 3 2 5 3 26000000 36 4 5 10 5 1100000 234 5 1 2 3 29000000 100 6 1 5 2 16000000 15 7 3 0 3 16000000 45 8 5 2 3 -16000000 34 9 5 10 5 1100000 234 10 1 2 3 29000000 4000 11 4 6 6 29000000 6000 Columns 7 through 8 2000 45000 0.1 45000 1.2 60750 1 375 17 45000 99 24000 60 36750 120 36750 5 375 0.5 45000 50 45000
How would I go about making it show up in a smaller matrix similar to this
1 1 2 3 29000000 10 2000 450002 3 0 4 29000000 5000 0.1000 450003 2 5 3 26000000 36 1.2000 607504 5 10 5 1100000 234 1 3755 1 2 3 29000000 100 17 450006 1 5 2 16000000 15 99 240007 3 0 3 16000000 45 60 367508 5 2 3 -16000000 34 120 367509 5 10 5 1100000 234 5 37510 1 2 3 29000000 4000 0.5000 4500011 4 6 6 29000000 6000 50 45000
I can provide more code if needed!
Best Answer