Effacer les filtres
Effacer les filtres

How to get different results from mldivide

2 vues (au cours des 30 derniers jours)
Meytal
Meytal le 15 Août 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).

Réponses (2)

Walter Roberson
Walter Roberson le 15 Août 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 le 15 Août 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 commentaire
Meytal
Meytal le 15 Août 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?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Operating on Diagonal Matrices dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by