Info
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
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 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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))
0 Commenti
Risposte (1)
Thorsten
il 28 Set 2016
Modificato: Thorsten
il 28 Set 2016
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 .*
1 Commento
Questa domanda è chiusa.
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!