Creating an algorithm for a Simultaneous Equation

조회 수: 3 (최근 30일)
Abdullahi Abubakar
Abdullahi Abubakar 2021년 3월 31일
댓글: Abdullahi Abubakar 2021년 3월 31일
3000x + 1000y = 35000 (1)
240x + 5y = 1665 (2)
Please can you help me create an algorithm that will keep increasing the value of 3000 by 20% (i.e 3000 + 20%*3000) and at the same time giving the corresponding results of "x" and "y".
Thank you in anticipation.

채택된 답변

David Hill
David Hill 2021년 3월 31일
k=3000*(.2).^(0:10);%however long you want
for j=1:length(k)
A=[k(j) 1000;240 5];
b=[35000;1665];
out(j,:)=A\b;
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by