フィルターのクリア

Info

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

I'm writing a function where I've called the script AngleA and the function written below works fine to find AngleA but when I write a similar code for AngleB it says that AngleB isn't defined how do I define the variable or fix the error?

1 回表示 (過去 30 日間)
Khalid Tewfik
Khalid Tewfik 2016 年 9 月 28 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
function [A] = AngleA(a,b,c) AngleA = acosd((b^2 + c^2 - a^2)/(2*b*c)) function [B] = AngleB(a,b,c) AngleB = acosd((a^2 + c^2 - b^2)/(2*a*c))

回答 (1 件)

Thorsten
Thorsten 2016 年 9 月 28 日
編集済み: Thorsten 2016 年 9 月 28 日
In file AngleA.m, write
function A = AngleA(a,b,c)
A = acosd((b^2 + c^2 - a^2)/(2*b*c));
in file AngleB.m write
function B = AngleB(a,b,c)
B = acosd((a^2 + c^2 - b^2)/(2*a*c));
If a, b, c can be vectors, you have to replace
^ with .^
* with .*

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by