Issues with Symbolic Solve
Ältere Kommentare anzeigen
I'm using R2012a and have run across the following issue when using the function solve.
syms a b c
temp = solve(a*b+c)
I get temp = -a*b, which I as a human know is the solution for c, but my code couldn't tell this without trying to substitute in -a*b in for a, then b, and finally c. Why don't I get a vector of results [z1, z2, -z1*z2]? So I try the following...
temp = solve(a*b+c,a,b,c)
I get a warning "1 equations in 3 variables..., " and the result I get is empty. So I try the following...
temp = solve(a*b+c,a,a,b,c)
I get a warning "1 equations in 4 variables...," and the result I get is almost what I would expect
temp.a = -z2/z1, z
temp.b = z1
temp.c = z2
I have no idea why I'm getting two solutions for a. When I try the following so that I have an equal number of equations and variables I don't get a warning, but I do get an empty result.
syms z
temp = solve(a*b+c,z,2*z,a,b,c)
I've also tried adding " == 0" to the equations to no avail.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Utilities for the Solver finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!