-2

Objective of the project:

To solve a simultaneous equation consisting of two linear equations using Matrices, the formula:

                     X = A^-1 * B

Where A is the matrix consisting of the coefficants of the two equations, B is the matrix consisting of the result of the two equations, and X is the matrix consisting of the two variables, x and y.

Language used: HTML and JavaScript in a single file.

The problem:

My first version of the project is here as follows:

https://pastebin.com/mgGReYTL

When I open it in my browser (Google Chrome latest version), the HTML part works as expected, however, when I click the "Solve" button, it doesn't do anything.

So I tried to use another approach:

https://pastebin.com/RbykTH0y

But the results are still the same (HTML working fine whereas clicking the "Solve" button does nothing).

Can anyone kindly spend a little bit of their times and try to provide me with a solution to this problem.

Your efforts, your solutions , will be highly appreciated. :-)

P.S : The code is actually not that big.

  • Welcome to Stack Overflow! The full content of your question must be **in** your question, not just linked. Links rot, making the question and its answers useless to people in the future, and people shouldn't have to go off-site to help you. Put a [mcve] **in** the question, ideally using Stack Snippets (the `<>` toolbar button) to make it runnable ([here's how to do one](https://meta.stackoverflow.com/questions/358992/ive-been-told-to-do-a-runnable-example-with-stack-snippets-how-do-i-do-tha)). More: [*How do I ask a good question?*](/help/how-to-ask) – T.J. Crowder Nov 11 '17 at 16:14

1 Answers1

1

The problem is that your function is called "multiply2d*1d". The '*' character is not allowed inside a name in js. For more rules see: What characters are valid for JavaScript variable names?

Here a working fiddle (I just changed the function name): 

https://jsfiddle.net/zfkjtax4/

user2887596
  • 641
  • 5
  • 15