How to solve for a series of variables that intersect with each other?
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi folks, recently I got a problem about solving a series of variables which have the property like:
x1 x2 x3 x4 x5 x6 x7 x8 x9 x10, where x1 and x10 are known, and the relationships are as following:
x2=x1^2+x3^3;
x3=x2^2+x4^2;
x4=x3^2+x5^2;
...
Intuitively there are in total 8 unkown variables and 8 equations so we can get value of each of them, but how can I solve these functions in matlab? What if there are more than just 10 variables, say 100, from x1 to x100, how can I solve the functions for x2 to x99? I tried to solve this as solving a system of linear equation but failed.
댓글 수: 5
Walter Roberson
2019년 2월 24일
x = sym('x', [94, 1]);
myfunc = parameter*[0;x;12]==b;
sol = solve(myfunc, x);
X = vpa( struct2cell(sol) );
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!