Matlab and large abreviated matrices

  • Context: MATLAB 
  • Thread starter Thread starter scsig805
  • Start date Start date
  • Tags Tags
    Matlab Matrices
Click For Summary
SUMMARY

The discussion centers on how to suppress output in MATLAB when creating large matrices, specifically using the command rand. Users can prevent MATLAB from displaying the matrix coefficients by appending a semi-colon to the command. For example, executing A = rand(3); generates a 3x3 matrix without displaying its contents in the command window. This method is essential for managing output in MATLAB, especially when dealing with larger matrices.

PREREQUISITES
  • Basic understanding of MATLAB syntax
  • Familiarity with matrix creation using rand function
  • Knowledge of command line operations in MATLAB
  • Experience with output management in programming environments
NEXT STEPS
  • Explore MATLAB's documentation on matrix operations
  • Learn about other output suppression techniques in MATLAB
  • Investigate performance implications of large matrix handling in MATLAB
  • Study advanced matrix manipulation functions in MATLAB
USEFUL FOR

MATLAB users, data analysts, and researchers working with large datasets who need to manage output efficiently while performing matrix operations.

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!
 

Similar threads

  • · Replies 32 ·
2
Replies
32
Views
4K
  • · Replies 9 ·
Replies
9
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 10 ·
Replies
10
Views
4K
Replies
3
Views
4K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 4 ·
Replies
4
Views
8K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 18 ·
Replies
18
Views
3K