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

  • SEARCH
  • Home
  • 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 7921061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:26:39+00:00 2026-06-03T16:26:39+00:00

i am trying this code since last night but i cant understand what this

  • 0

i am trying this code since last night but i cant understand what this code is doing. actually i am beginner in matlab programming

 load('79.mat')
 trainingData=d79;
 colormap(gray);
 colormap(grey);
 x=reshape(d79(1234,:),28,28);
 y = x(:,28:-1:1); 
 pcolor(y');

Kindly help me in understanding this code. :/

  • 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-06-03T16:26:42+00:00Added an answer on June 3, 2026 at 4:26 pm

    This is pretty simple. Here is a line-by-line explanation:

    1. Loads data from a data file
    2. Puts the loaded data into a variable named trainingData
    3. Sets the colormap for plotting
    4. Take the 1234th row of the loaded matrix, convert it into a 28-by-28 matrix, and store it in the variable x. So for example, on a smaller scale, [5 6 7 8] is converted to the matrix [5 7; 6 8] if you want to reshape that matrix to 2-by-2.
    5. Reverse the column order of x and put that in y. So the last column becomes the first, second-last becomes second, etc.
    6. This is a checkerboard plot of the values contained in y.

    Edited to include more detail on lines 5 and 6:

    The reshape line assumes that there is a row with number 1234, and that there are 784 (28*28) elements in that row. It takes that row, and makes a 28×28 matrix out of it, by taking the first 28 elements, making them into the first column of the new matrix, then taking the next 28 elements, making them the second column, and so on 26 more times. The final matrix is names x.

    For the y line, like I said, it just reverses the columns of x, it puts the last column first, the second-last column second, and so on until the first column of the x is put as the last column of y.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying this code to access a property but it gives me an error:
I am new to Django and was trying this code in a tutorial. But
I'm trying this code for entering values into multidimensional char array in C. The
I am trying this code: entLoop:for(var i:*in entities) { for(var i2:*in ignoreEntities) { if(entities[i].type==ignoreEntities[i2])
To be specific, I was trying this code: package hello; public class Hello {
I was trying out this code. execute EXE from memory I am hitting on
Boost Network I am trying out this code in a small console app on
Trying to use this code to connect the AD PrincipalContext context = new PrincipalContext(ContextType.Domain,
Im trying to use this code to toggle between a play and pause button
I trying to compile this code: Int64 itag = BitConverter.ToInt64(temp, 0); itag &= 0xFFFFFFFFFFFFFC00;

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.