MATLAB Matlab and large abreviated matrices

  • Thread starter Thread starter scsig805
  • Start date Start date
  • Tags Tags
    Matlab Matrices
AI Thread Summary
To keep matrices in abbreviated form in MATLAB, users can suppress output by adding a semi-colon at the end of the command. For example, using "A = rand(3);" will create a 3x3 matrix without displaying the coefficients, while "A = rand(3)" will show the full matrix. This method effectively prevents MATLAB from outputting the matrix coefficients each time the command is executed.
scsig805
Messages
11
Reaction score
0
Can anyone tell me how to make MATLAB keep matrices in abreviated form? For example I want a rand(100*100) matrix that doesn't have all the coefficients listed out. Thanks Sean.
 
Physics news on Phys.org
It's not really clear to me what you want to do. Are you asking how you can stop MATLAB from outputting the coefficients of the matrix each time you access it on the command line?

If so, that's easy. You can suppress output from any command in MATLAB by placing a semi-colon after the command. For instance, suppose that you want to quickly construct a 3x3 matrix whose entries are values drawn from a uniform normal distribution. In that case

Code:
>> A = rand(3)

A   = 

    0.8147    0.9134    0.2785
    0.9058    0.6324    0.5469
    0.1270    0.0975    0.9575

You can get precisely the same matrix but suppress the output by passing the same command with a semi-colon at the end:

Code:
>> A = rand(3);
>>

Is this what you're asking about?
 
that was exactly what I was asking about thank you very much!
 
Back
Top