필터 지우기
필터 지우기

Solve for multiple values

조회 수: 4 (최근 30일)
Maruf Hoque
Maruf Hoque 2017년 4월 5일
답변: Varun Gunda 2017년 4월 7일
I have three different polynomial equations:
eq1: 5*x^3+3*x^2+4*x+5
eq2: 0.05*x^2+4*x+5
eq3: 100*x^4+5*x^2+10
I have a set of 50 numbers that I would like to solve for. (For now, let's say x equals every whole number from 1-50). Is there a way where I can create a 4x50 table with all of the input and output values solved?
(I don't have to have everything in a table, exporting to a txt file would be ok as well. My Matlab expertise is not that great)
  댓글 수: 1
KSSV
KSSV 2017년 4월 5일
You want to h ave the values of the polynomials equations for x = 1 to 50?

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

답변 (1개)

Varun Gunda
Varun Gunda 2017년 4월 7일
You can try the following:
ipop = zeros(4,50);
for x=1:50
eq1= 5*x^3+3*x^2+4*x+5;
eq2= 0.05*x^2+4*x+5;
eq3= 100*x^4+5*x^2+10;
ipop(:,x) = [eq1 eq2 eq3 x];
end

카테고리

Help CenterFile Exchange에서 Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by