Filter löschen
Filter löschen

Solve function returns Warning and empty matrix

1 Ansicht (letzte 30 Tage)
Akash Batra
Akash Batra am 16 Jun. 2015
Beantwortet: Eric Lin am 17 Jun. 2015
I run this code to solve for u and v
syms u v
S = solve([2*u + v == 0, u - v == 1], [u, v])
I get warning saying I have 4 equations and 2 unknowns and a warning that says it cannot find an explicit solution when there is a clear solution to the system. I have other codes that I try to use solve and get the same warnings.
Is there a toolbox I need to download or why can't I use solve?
  1 Kommentar
Walter Roberson
Walter Roberson am 16 Jun. 2015
As an experiment try
S = solve([2*u + v, u - v - 1], [u, v])
If that works then you might be running an older version of MATLAB that does not handle "==" for symbolic variables.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Eric Lin
Eric Lin am 17 Jun. 2015
To add to Walter's answer, the "==" notation was introduced in R2012a: R2012a Release Notes - New Relational Operators Create Equations, Inequalities, and Relations

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by