How do I append my answers in an array, while using loop?
显示 更早的评论
Good day, please can someone help me with this problem?
In the code below, I want to add the following conditions:
- Solve the equation 10 times using a "for" loop or while function. That is, have a variable L=10, and substrate 1 from it after each iteration. End loop, when L=0.
- Create an array of two column vectors for the x and y values from each iteration, with x=6, and y=5 as the first values of this array. Similar to append.
- Each solution of x and y, will be used as the z and w values for the next iteration.
z = 6;
w = 5;
syms x y
eqn1 = x + y + z + w == 13;
eqn2 = 2*x + 3*y - w == -1;
sol = solve([eqn1, eqn2], [x,y]);
xSol = sol.x
ySol = sol.y
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Linear Algebra 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!