unitConvert isn't converting to Hz
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Henrique Simas
am 16 Jan. 2021
Kommentiert: Henrique Simas
am 16 Jan. 2021
I'm using symunit and need to convert 1/sqrt(Henry*Farad) to Hz. I have the following test code:
L = 10*u.nH;
C = 10*u.fF;
unitConvert(1/sqrt(L*C), u.GHz)
The output is:
1/(10*([fF]*[nH])^(1/2))
I think it should be in Hz but it doesn't convert to it. Am I wrong in saying Hz = 1/sqrt(Henry*Farad) or is it something wrong in the code?
0 Kommentare
Akzeptierte Antwort
David Goodmanson
am 16 Jan. 2021
Hi Henrique.
you can get there with
u = symunit
L = 10*u.uH;
C = 10*u.fF;
unitConvert(simplify(unitConvert(1/sqrt((L*C)), u.sec)),u.GHz)
ans = 10^(1/2)*[GHz]
but of course it would be a lot better if it just did the conversion you wanted in the first place.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!