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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:32:30+00:00 2026-06-10T21:32:30+00:00

I have an array of high dimensional however very sparse matrices. I want to

  • 0

I have an array of high dimensional however very sparse matrices. I want to normalize them so that column sums of all matrices sum to one.

Here is the sample code I use:

bg = matrices{1};
for i = 2:length(matrices) , bg = bg + matrices{i}; end
normalizer = sum(bg);
for i = 1:length(matrices) 
    for j = 1:size(matrices{i},1)
        matrices{i}(j,:) = matrices{i}(j,:) ./ normalizer;
    end
end

However as you can guess this is very slow. One alternative is:

for i = 1:length(matrices) 
    matrices{i} = matrices{i} ./ repmat(normalizer,size(matrices{i},1),1);
end

but this halts because there is not enough memory to create a huge and nearly full matrix (repeated with normalizer)

Can you suggest a better alternative?

  • 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-10T21:32:32+00:00Added an answer on June 10, 2026 at 9:32 pm

    If you converted your problem to a single sparse matrix, then you could use

    bsxfun(@rdivide,A,normalizer);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array that stores the order that I want to sort a
I have an OHLC array of stock quotes that I want to process. Open
I have an array of bytes that is referenced in some high-level client/developer documentation
I have an string array {ted, williams, golden, voice, radio} and I want all
I have a float array that I get from a sensor and want to
i have an array that looks like: array(5) { [title]=> string(22) http://example.com/288 [title2]=> string(22)
I have an array of arrays in javascript set up within an object that
I have an array of uint64 and for all unset bits (0s), I do
I have a json record like blow [{low:null,high:10,type:2,value:0},{low:10,high:60,type:1,value:10},{low:60,high:null,type:2,value:11}] I would like to create array
I have a sorted integer array on the device, e.g.: [0,0,0,1,1,2,2] And I want

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.