function in matlap#

조회 수: 4(최근 30일)
Matthew Hayes 2021년 5월 6일
답변: Jan 2021년 5월 6일
I am having a problem with function in matlap. I have these questions and i dont really know where to start. I am new to matlap and functions so i could use some help.
Converting Bitcoins to pound sterling.
In April 2021 the conversation rate between mBTC (milli-Bitcoin) and British Pounds (GBP or £) is 1 mBTC = 40.34 £ (a) Find the function x f −→ y = f(x) which converts a value in mBTC denoted by x to a value in £denoted by y.
(b) Write the corresponding function in matlab.
(c) Using a for-loop, plot a few values on a graph.
(d) Find the inverse function which converts £to mBTC and plot it.
I dont even know where to start.

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

답변(3개)

Stephan 2021년 5월 6일
댓글 수: 0표시숨기기 이전 댓글 수: -1

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

Walter Roberson 2021년 5월 6일
f = @(x) x * appropriate_multiplier_goes_here - transaction_cost(x)
where transaction_cost is a function that calculates the transaction cost of converting x Bitcoins into pounds.
댓글 수: 0표시숨기기 이전 댓글 수: -1

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

Jan 2021년 5월 6일
The actual problem is trivial: All you have to do is to multiply the input by a scalar.
Your problem is most likely (you didn't explain this important detail), that you do not know how to write a function. Then please read the "Getting Started" chapters of the documentation and solve this free online course: https://www.mathworks.com/learn/tutorials/matlab-onramp.html

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

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by