solve n equation with n Variable
Mostrar comentarios más antiguos
I want to write a program that get n from user and solve n equation with n variable. How should I write solve command.
variable: syms V1 , V2 , ... , Vn
equations: eq=[eq1 eq2 ... eqn]
solve(eq(1:end),V1,V2,...,Vn)
My question is about writing n variable at solve command. Thanks.
Respuesta aceptada
Más respuestas (1)
Yagna V
el 22 de En. de 2020
1 voto
clc;
clear all;
n=input("Enter Number of Equations to be formed: ");
syms v [1,n]
for i=1:n
eqn(i) = (v(i)+1)^2+(v(i)-1)^2==20;
disp(eqn(i));
end
S=solve(eqn)
After this u get an array where the values are stored in symbols
Categorías
Más información sobre Mathematics en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!