Creating Vectors With Logspace() Command In MatLab(Illustrated Expression)
We explained the creating vectors with ‘linspace()’ command in Matlab. There is an another command that you can create vectors in a different manner compared to linspace() called as logspace(). In this article we will explain;
- The logic of logspace() command in Matlab.
- How to use logspace() command in Matlab.
What Is Logspace() Command In Matlab?
To create vectors in Matlab with logspace() command, you just need to type three of numbers inside the parantheses of logspace(). You can assing this command to a variable as shown by red arrow above. And also you do mathematical calculations with the vectors that created by logspace() command in Matlab as shown by green arrow.
The first number inside the parantheses means the first element of vecotr will start with this exponent of 10. As you see from above example, we typed the number of ’1’ inside logspace() command, the first number is the multiplacation of 1.0r+03(1000 in scientific expression) with 0.01 which equals 10. So 10 over 1 is 10.
The second that is typed inside the pharantheses of logspace() means at which exponent of 10 the last number will be. We typed as ‘3’, that means the las number is 10 over 3. As yuo see from above example results that the last number is 1.0e+03*1.0000 which equals to 1000.
The last number that we typed, divides the last and first exponents into the equal spacing in that number. So the number elements inside the created vector with logspace() command in Matlab will be that number. We entered it as ‘6’, and the exponents of 10 in each element is divided 6, between 1 and 3.
The use of logspace() command in Matlab can be expressed like above. If you have any questions or comments about logspace() command in Matlab, do not forget to leave them below!