Solving equations in Matlab

I am trying to solve a transcendental equation in Matlab, as follows:
fAc=solve((QAc-1)/(QAc+1)==f*arccosh(exp(0.693/f)/2),f);
I am getting the error:
Undefined function or variable 'f'.
Error in analyz (line 74)
fAc=solve((QAc-1)/(QAc+1)==f*arccosh(exp(0.693/f)/2),f);
and I'm not sure how to fix it. I have given QAc fake values that are approximately what they will really be.
Adding a "syms fAc" gives the error:
Undefined function 'arccosh' for input arguments of type 'sym'.
If I try to solve it in Mathematica, I get a complex number (and I want to eventually take the absolute value of it if it ends up being complex).
I know that Mathematica solves this a lot easier, but I'm not sure how to use the "ToMatlab.m" package that I've seen people refer to.
Any help is appreciated.
Thanks.

2 件のコメント

Walter Roberson
Walter Roberson 2013 年 4 月 29 日
Do you perhaps mean
syms f QAc
Grant
Grant 2013 年 4 月 29 日
I get the same error if I try that.

サインインしてコメントする。

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 4 月 29 日

1 投票

It's not arccosh, It's acosh

3 件のコメント

Grant
Grant 2013 年 4 月 29 日
I was using this as reference. I am using 2012a. Also, I get the same error if I change it to acosh.
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 4 月 29 日
syms QAc f
fAc=solve((QAc-1)/(QAc+1)==f*acosh(exp(0.693/f)/2),f);
Grant
Grant 2013 年 4 月 29 日
編集済み: Grant 2013 年 4 月 29 日
That works, thank you very much.
Would you mind giving a brief explanation as to why it does, as compared to what I was doing?
Thanks a lot.
EDIT: I just want to make sure, this will work if I give QAc a value right? or would I just remove QAc from the line "syms QAc f"?

サインインしてコメントする。

その他の回答 (0 件)

製品

Community Treasure Hunt

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

Start Hunting!

Translated by