Matlab and large abreviated matrices

  • Context: MATLAB 
  • Thread starter Thread starter scsig805
  • Start date Start date
  • Tags Tags
    Matlab Matrices
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 3K views
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!