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 7034897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:14:26+00:00 2026-05-28T01:14:26+00:00

I have data saved from each loop run and it looks like this. val

  • 0

I have data saved from each loop run and it looks like this.

val =

   (1,1)      16.0000

   (9,1)       0.0017

  (10,1)       0.0040

  (11,1)       0.0049

  (12,1)       0.0048

  (13,1)       0.0043

The matrix is 50×50, however only the cells that contain the specific element are showed in this save.

I know that those are the values and their corresponding locations.

I want to know what this format is and how can I count the the number cells shown this way quickly.

  • 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-28T01:14:27+00:00Added an answer on May 28, 2026 at 1:14 am

    This is a sparse matrix, as @Oli already said correctly. I will try to elaborate a little bit.

    You create it with the following commands:

     s = sparse(zeros(13,13));
     s(1,1) = 16;
     s(9,1) = 0.0017;
     s(10,1) = 0.0040;
     ...
    

    Convert it back to full matrix by using full command:

     f = full(s);
    

    And it you want to count the number of entries, use nnz. It counts the number of non zero entries:

     z = nnz(s);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a internal website that users log into. This data is saved as
I have a PHP script that grabs data from an external service and saves
I have saved data which was saved using NSUserDefaults. I was under the impression
I have a Data Access Object TransactionDao. When you call TransactionDao.Save(transaction) I would like
I'm trying to add an object created from Entity Data Model classes. I have
I have a std::vector< tr1::shared_ptr<mapObject> > that I'm trying build from data contained in
I have a set of classes something like this: abstract class CollectionAbs implements Iterator
I have a jquery script that collects data from different sites and saves it
I have a rake task that fetches JSON data from an API, parses it,
I have following data to save in database using php my data is :

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.