필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Help on solving equation

조회 수: 1 (최근 30일)
Stephen
Stephen 2012년 4월 2일
마감: MATLAB Answer Bot 2021년 8월 20일
Hello,
I have an equation:
((w^2)/g) = k*tanh(k*d)
and I need to solve for k, but I have 50 w values and I am not sure how to solve for 50 k values. I know how to solve for it if only have one w value, but not for 50. If some one could please help me out that would be great. Thanks.
w = w = 0.188:0.021363:1.256

답변 (3개)

Sean de Wolski
Sean de Wolski 2012년 4월 2일
Use a for-loop to loop through your w values.
for ii = 1:numel(w)
solve_with_w(ii)
end
  댓글 수: 1
Sean de Wolski
Sean de Wolski 2012년 4월 2일
The same way you normally do? You want one k value for each w value correct? Otherwise what are you trying to do? Come up with a best k for all w? Add more detail to your question

Stephen
Stephen 2012년 4월 2일
How does this solve for "k" and when use that code it says it doesn't like "solve_with_w(ii)

Stephen
Stephen 2012년 4월 2일
so I have 50 w values and for each w value I need a corresponding k value using the equation
((w^2)/g) = k*tanh(k*d)
I need to solve for 1 k value using a corresponding w value
so end the end I will have 50 w values and each one of those will have their on k value (which means I will have 50 k values in the end)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by