필터 지우기
필터 지우기

Solve Symbolic Simultaneous equations -- Please help!!

조회 수: 1 (최근 30일)
Omar Khammash
Omar Khammash 2020년 10월 22일
답변: Walter Roberson 2020년 10월 29일
I am attempting the following code to solve for a,b,c, and d. i keep getting an error saying a does not exist, what i am looking for is a solution for a b c d in terms of n and t
clear all; close all; clc;
syms a b c n t d
eqns = [ a + b + c + d == 0, a*(n^3)+ b*(n^2)+ c*n+ d == t, 3*a*(n^2)+ 2*b*n +c == 0];
S = solve(eqns);
S.a
S.b
S.c
S.d
the error i get is
Reference to non-existent field 'a'.
Error in Untitled (line 7)
S.a
  댓글 수: 1
Alan Stevens
Alan Stevens 2020년 10월 23일
You are asking for four unknowns but you only have three equations!

댓글을 달려면 로그인하십시오.

답변 (2개)

Manvi Goel
Manvi Goel 2020년 10월 29일
You will require four equations to calculate values of four unknowns. You only have 3 here.
a + b + c + d == 0, (1)
a*(n^3)+ b*(n^2)+ c*n+ d == t, (2)
3*a*(n^2)+ 2*b*n +c == 0, (3)

Walter Roberson
Walter Roberson 2020년 10월 29일
S = solve(eqns, [a, b, c, d]);

카테고리

Help CenterFile Exchange에서 Conversion Between Symbolic and Numeric에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by