Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3243056
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:23:16+00:00 2026-05-17T18:23:16+00:00

I am using MATLAB and having some issues formatting the output of a matrix.

  • 0

I am using MATLAB and having some issues formatting the output of a matrix. Currently, the matrix looks like:

  Columns 1 through 7

     4     6     5     1     0     0     0
     7     8     4     0     1     0     0
     6     5     9     0     0     1     0
     1     0     0     0     0     0    -1
     0     1     0     0     0     0     0
     0     0     1     0     0     0     0

  Columns 8 through 9

     0     0
     0     0
     0     0
     0     0
    -1     0
     0    -1

Is there a way to get the whole matrix to show up “closer” together, something like this:

 1     0     0     0     0     0
 0     1     0     0     0     0
 0     0     1     0     0     0
 0     0     0    -1     0     0
 0     0     0     0    -1     0
 0     0     0     0     0    -1
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:23:17+00:00Added an answer on May 17, 2026 at 6:23 pm

    To customize the output, you could try something like:

    x = randi(100, [6,9]);
    
    for i=1:size(x,1)
        fprintf('%d\t',x(i,:));
        fprintf('\n');
    end
    
    23  44  26  23  9   49  53  37  10  
    18  19  41  12  27  58  24  99  27  
    23  91  60  30  81  24  49  4   34  
    44  98  27  32  3   46  63  89  68  
    32  44  61  43  93  97  68  92  14  
    93  12  72  51  74  55  40  80  73  
    

    Or more easily, you could use the NUM2STR function:

    x = randi([-10 10], [6 9]);
    num2str(x)
    
    ans =
     2   1   7   8   9  -1  -1   9   5
     6   8  -3   9  -4   3   8   4   8
    -2  -9  -7   4  -9  -7  -8  -6   7
     1   6 -10   9   6   1  -1   1  -8
     9  -3  10  -5  -9   3   3   8  -7
     8  -6   4   8   5 -10  -4   1  -7
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to test the Flickr API using Matlab. There is no Flickr
Im using matlab and am having some difficulty. I am trying to swap the
I have an assignment to create a GUI using MATLAB GUIDE and am having
I am currently a begineer, and i am using matlab to do a data
I've recently begun using MathNet to implement our linear algebra, however I'm having some
I am on my transitional trip from MATLAB to scipy(+numpy)+matplotlib. I keep having issues
I have some differential equations that I need to solve using MATLAB's ODE solvers.
I'm trying to compute a rather ugly integral using MATLAB. What I'm having problem
I'm using an eye tracking device with MATLAB. Having an active internet connection whilst
I'm using Matlab to find effective ways of deconvolving the output of a spectrometer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.