cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
a_betancourt
Level I

Create a log-space vector

All-

I am new to JSL and I want to know if there is an easy way to create a log-space vector--similarly to the function in MATLAB or Numpy.

Thanks.

 

-Alvaro

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Create a log-space vector

Hi,

 

This isn't built-in but fortunately isn't difficult, using the log10 function and matrices. Here are 2 examples with log output for each.

 

Cheers,

Brady

 

Names Default To Here( 1 );

//ex1: generate 9 logarithmically-spaced points between 10^3 and 10^7
lowExp = 3;
highExp = 7;
logVec1 = 10 ^ (lowExp :: highExp :: ((highExp - lowExp) / 10));
show (round(logVec1, 2));
print("\!n");

//ex2: generate 14 logarithmically-spaced points between 250 and 875
lowExp = log10(250);
highExp = log10(875);
logVec2 = 10 ^ (lowExp :: highExp :: ((highExp - lowExp) / 15));
show(round(logVec2, 2));

brady_brady_0-1616084204347.png

 

 

View solution in original post

1 REPLY 1

Re: Create a log-space vector

Hi,

 

This isn't built-in but fortunately isn't difficult, using the log10 function and matrices. Here are 2 examples with log output for each.

 

Cheers,

Brady

 

Names Default To Here( 1 );

//ex1: generate 9 logarithmically-spaced points between 10^3 and 10^7
lowExp = 3;
highExp = 7;
logVec1 = 10 ^ (lowExp :: highExp :: ((highExp - lowExp) / 10));
show (round(logVec1, 2));
print("\!n");

//ex2: generate 14 logarithmically-spaced points between 250 and 875
lowExp = log10(250);
highExp = log10(875);
logVec2 = 10 ^ (lowExp :: highExp :: ((highExp - lowExp) / 15));
show(round(logVec2, 2));

brady_brady_0-1616084204347.png

 

 

Recommended Articles