% Script for solving equation with one variable using the solve function
% sytax :
% S = solve(eqn,var) solves the equation eqn for the variable var.
% load symbolic package, and initilize PYTHON variable. (Octave only).
pkg load symbolic
setenv PYTHON C:\ProgramData\Anaconda3\pythonw.exe
% Declare symbolic and variables and parameters
syms a b c x
% Define the equation to solve:
eqn = a*x^2 + b*x + c == 0
% activate solve function for x
S = solve(eqn, x)
% Solve for b:
Sb = solve(eqn, b)
Output
No comments:
Post a Comment