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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:20:55+00:00 2026-05-27T15:20:55+00:00

I can’t figure out how to get the values for the resulting matrix using

  • 0

I can’t figure out how to get the values for the resulting matrix using MathNet, can anyone please help? I have a 4 column, 3 row matrix which represents 3 polynomials and I am trying to solve for a=, b=, c=. row1 representing a, 2 b, 3 c. I cannot figure out how to use MathNet’s functionality to get these values or if it even does that.

        double X1 = Convert.ToDouble(x1);
        double Y1 = Convert.ToDouble(y1);

        double X2 = Convert.ToDouble(x2);
        double Y2 = Convert.ToDouble(y2);

        double X3 = Convert.ToDouble(x3);
        double Y3 = Convert.ToDouble(y3);

        var a = new DenseMatrix(3, 4);

        double[] row1 = new double[2];
        row1[0] = X1;
        row1[1] = Y1;

        double[] row2 = new double[2];
        row2[0] = X2;
        row2[1] = Y2;

        double[] row3 = new double[2];
        row3[0] = X3;
        row3[1] = Y3;

        a.SetRow(0, row1);
        a.SetRow(1, row2);
        a.SetRow(2, row3);

EDIT:

If you want to try the solution you can set matrix = to

            double[,] matrix = new double[3, 4]{
            {  1, 2, -1,  -4 },
            {  2, 3, -1, -11 },
            { -2, 0, -3,  22 }
        };
  • 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-27T15:20:56+00:00Added an answer on May 27, 2026 at 3:20 pm

    Solved not even using MathNet:

    int lead = 0, rowCount = 3, columnCount = 4;
            for (int r = 0; r < rowCount; r++)
            {
                if (columnCount <= lead) break;
                int i = r;
                while (matrix[i, lead] == 0)
                {
                    i++;
                    if (i == rowCount)
                    {
                        i = r;
                        lead++;
                        if (columnCount == lead)
                        {
                            lead--;
                            break;
                        }
                    }
                }
                for (int j = 0; j < columnCount; j++)
                {
                    double temp = matrix[r, j];
                    matrix[r, j] = matrix[i, j];
                    matrix[i, j] = temp;
                }
                double div = matrix[r, lead];
                for (int j = 0; j < columnCount; j++) matrix[r, j] /= div;
                for (int j = 0; j < rowCount; j++)
                {
                    if (j != r)
                    {
                        double sub = matrix[j, lead];
                        for (int k = 0; k < columnCount; k++) matrix[j, k] -= (sub * matrix[r, k]);
                    }
                }
                lead++;
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone help me trying to find out why this doesn't work. The brushes
Can't figure out how to do this in a pretty way : I have
Can anyone (maybe an XSL-fan?) help me find any advantages with handling presentation of
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Can anyone suggest how to underline the title of a UIButton ? I have
Can i get the source code for a WAMP stack installer somewhere? Any help
Can anyone help me with an excel formula that groups related rows and creates
Can anyone tell me how to hide the header in DevExpress gridcontrol..?? I'm using
Can anyone tell me how I can display a status message like 12 seconds
Can I get a 'when to use' for these and others? <% %> <%#

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.