Created
October 16, 2020 18:06
-
-
Save IPlayZed/b240865b9433d6c001fb87366b0f1e61 to your computer and use it in GitHub Desktop.
MATLAB function for creating logarithmically spaced row vector, with given length, between given numbers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%Written by Balázs Börcsök, as of 12/10/2020. | |
%Licensed under GNU GPL v2: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html | |
function generatedArray=logarithmicIntervalN(low,high,N) | |
lowLog=log10(low); | |
highLog=log10(high); | |
step=(highLog-lowLog)/N; | |
exponentArray=lowLog:step:highLog; | |
[~,expArraySize]=size(exponentArray); | |
logarithmicSizedArray=(ones(1,expArraySize).*10).^exponentArray; | |
generatedArray=logarithmicSizedArray; | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment