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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:15:03+00:00 2026-05-26T04:15:03+00:00

I want to multiply 2 matrix using Jama library but it returns: A col:

  • 0

I want to multiply 2 matrix using Jama library but it returns:

A col: 4 row: 4
B col: 1 row: 4
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Matrix dimensions must agree.

My code:

double[][] arrA = { {1,0,0,0}, {0, Math.cos(0.34), -Math.sin(0.34), 0}, {0, Math.sin(0.34), Math.cos(0.34), 0}, {0,0,0,1} };
        double[][] arrB = { {x}, {y}, {z}, {1} };
        Matrix A = new Matrix(arrA, 4, 4);
        Matrix B = new Matrix(arrB, 4, 1);
        A.print(1, 1);
        B.print(1, 1);
        System.out.println("A col: " + A.getColumnDimension() + " row: " + A.getRowDimension());
        System.out.println("B col: " + B.getColumnDimension() + " row: " + B.getRowDimension());
        Matrix C = A.arrayTimes(B);
  • 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-26T04:15:03+00:00Added an answer on May 26, 2026 at 4:15 am

    You want to do A.times(B) for matrix multiplication.

    arrayTimes is element by element multiplication.

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

Sidebar

Related Questions

i want to multiply two 512 bit integers in java and store the result.suggest
I'd like to multiply a random number vector PT(n)=rand(1,n) by a matrix M(mxn) but
Hey! I have matrix class and i want to add, multiply and take transpose
I want to multiply two matrices but the triple loop has O(n 3 )
I want to multiply a sparse matrix A, with a matrix B which has
I don't want multiple windows, each with its own UI thread, nor events raised
I want to read multiple RSS feeds using jQuery. I'm trying to write a
I want to find a text * 50 (multiply sign space 50). How ?
say I want to multiply two matrices together, 50 by 50. I have 2
I want create texture atlas(matrix of images) from multiple images.Is their any applescript that

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.