How to use the logspace function to create a vector of frequencies in Hz and not rad/s
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Shikhar Singh
am 26 Okt. 2021
Beantwortet: Dave B
am 26 Okt. 2021
Given frequencies f1 and f2, low and high respectively, in Hz, how can I use the logspace function to create a vector of frequencies in Hz?
If f1 is 0.087Hz and f2 is 20Hz, creating a vector:
A = logspace(1,2)
would be incorrect as logspace takes in inputs as rad/s, how can i use logspace using the same values in Hz?
0 Kommentare
Akzeptierte Antwort
Dave B
am 26 Okt. 2021
To get logarithmically spaced values between 0.087 and 20:
logspace(log10(.087), log10(20))
To be clear, logspace doesn't take inputs in rad/s or Hz, it just takes values. But it expects exponents that 10 would be raised to, and so you can use log10 to convert your values.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Cell Arrays finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!