Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Take each looped value and put it into an equation

1 回表示 (過去 30 日間)
Lance
Lance 2012 年 11 月 25 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Here is my for loop
for i = 300:20:1000
K = exp(18.84-21788/i);
solve('(x^2/(1-x^2)) = K', 'x')
end
What I'm trying to get this to do is solve for K by incrementing i by 20 all the way up to 1000.
For each K I want to take that value, put it into the solve function and have it give me a numerical value for x. I also need x to be between 0 & 1.
I can't seem to figure this out. Thanks

回答 (1 件)

bym
bym 2012 年 11 月 25 日
no need to use the solve command
for i = 300:20:100
k = exp(18.84-21788/i);
xpos(i) = sqrt(k^2+k)/(k+1);
xneg(i) = -sqrt(k^2+k)/(k+1);
end

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by