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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:43:21+00:00 2026-05-20T06:43:21+00:00

Well, Trying to do something with search engines. I have generated a matrix (term-document)

  • 0

Well, Trying to do something with search engines.

I have generated a matrix (term-document) from a collection of 5 documents. The output is:

docs= (5,1) 1.0000
(1,2) 0.7071
(3,2) 0.7071
(1,3) 0.7071
(5,3) 0.7071
(3,4) 1.0000
(4,5) 1.0000

Also, I have generated a query matrix from user query.

q= (1,1) 1
(2,1) 1

I’m trying to find similarity of the document set with the user’s query applying Vector space modelling. Here goes the code:

% docs is a sprase matrix presenting a number of document.
sc=zeros(1, n); doc_inds=zeros(1, n);

% q is the user query. 
sc=q'*docs;

%sort documents according to their
similarity coefficient with the query
[sc, doc_inds]=sort(sc);
sc=sc(end:-1:1);doc_inds=doc_inds(end:-1:1);

The line sc=q'*docs; always produces error saying: ??? Inner matrix dimensions must . agree.

Can anyone help me getting an idea to deal with it ? Appreciate your time.

  • 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-20T06:43:22+00:00Added an answer on May 20, 2026 at 6:43 am

    According to the data in your example, docs is 5×5 and q is 2×1. The matrix multiplication q'*docs is attempting to multiply a 1×2 matrix with a 5×5 matrix. Matrix multiplication requires that the second dimension of the first matrix agrees with the first dimension of the second matrix, thus the error you are getting.

    Why are you defining sc at the line sc=zeros(1, n); and then overwriting it with this matrix multiplication?

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

Sidebar

Related Questions

Well,I am trying to do something similar what I did in Adobe Flex.Consuming a
Well, I was trying to select rows from one table if there are no
Ok well I'm trying implement something similar to the 'undo' function in many image
well iam trying to get version of IE used by user by using $.browser.version
Well I am trying to submit a form by pressing enter but not displaying
When trying to link some well established tools to my company's active directory, I
I'm trying to learn Ruby as well as Ruby on Rails right now. I'm
I was trying the ASP.NET login control tutorial and everything works well. However, I
Well, here's a nice obscure one. I'm trying to compile the latest open transport
I'm trying to display frequencies within barplot ... well, I want them somewhere in

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.