Azzera filtri
Azzera filtri

How to get different results from mldivide

2 visualizzazioni (ultimi 30 giorni)
Meytal
Meytal il 15 Ago 2011
Hi, I want to try and solve linear set of equations with mldivide, but if the solution is not good for me, I would like to get a different solution. Is there a way to get another solution by calling the function again? And How does MATLAB decides which solution to give? knowing this would help me decide if I need to look for a different solution, or there's no solution like the one I'm looking for (not negative).

Risposte (2)

Walter Roberson
Walter Roberson il 15 Ago 2011
We discussed this before. Your problem is not suitable for solution by linear algebra methods. The answer I gave before included a link to an article that lists a number of methods that are suitable for this type of problem.
(The problem is effectively a knapsack problem, or alternately, a set of linear diophontane equations restricted to non-negative multiples.)

Jan
Jan il 15 Ago 2011
The solution is "not good for you"?! MATLAB's MLDIVIDE calculates the numerically correct solution for quadratic systems and the least squares solution. This is explained in doc mldivide.
Please explain the details, if you want something different.
  1 Commento
Meytal
Meytal il 15 Ago 2011
I need an integer non-negative solution, and since, as far as I know, there is no way to ask that from matlab, I would like to 'iterate' over possible solutions.. Is there a way to do that?

Accedi per commentare.

Categorie

Scopri di più su Operating on Diagonal Matrices in Help Center e File Exchange

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by