x undefined (Catenary Cable Case Study)

조회 수: 1 (최근 30일)
Rean Manuel Clementir
Rean Manuel Clementir 2021년 3월 10일
답변: Sargondjani 2021년 3월 10일
Hi, I am hard coding an equation and the result is 'x' is undefined. What would went wrong with this? code below.
function fval = bisectCase2 (x)
fval = (x/12)*cosh((12/x)*(50))+6-(x/12)-15;
end

채택된 답변

Sargondjani
Sargondjani 2021년 3월 10일
What you have done is programmed a function. So this function calculates fval when you give a value of x.
You can now call this function by typing in the command prompt:
x=3;
fval = bisectCase2(x);
This will give you fval for x=3; Note that the function should be in the search path (so for example in your current directory).

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by