Skip to main content
Commonmark migration
Source Link

#MATLAB, 7 bytes

MATLAB, 7 bytes

An unnamed anonymous function:

@(n)1:n 

Run as:

ans(10) ans = 1 2 3 4 5 6 7 8 9 10 

Test it here!


If a full program is required, 17 bytes:

disp(1:input('')) 10 1 2 3 4 5 6 7 8 9 10 

Test it here!

#MATLAB, 7 bytes

An unnamed anonymous function:

@(n)1:n 

Run as:

ans(10) ans = 1 2 3 4 5 6 7 8 9 10 

Test it here!


If a full program is required, 17 bytes:

disp(1:input('')) 10 1 2 3 4 5 6 7 8 9 10 

Test it here!

MATLAB, 7 bytes

An unnamed anonymous function:

@(n)1:n 

Run as:

ans(10) ans = 1 2 3 4 5 6 7 8 9 10 

Test it here!


If a full program is required, 17 bytes:

disp(1:input('')) 10 1 2 3 4 5 6 7 8 9 10 

Test it here!

added 46 characters in body
Source Link
Stewie Griffin
  • 46.8k
  • 16
  • 140
  • 304

#MATLAB, 7 bytes

An unnamed anonymous function:

@(n)1:n 

Run as:

ans(10) ans = 1 2 3 4 5 6 7 8 9 10 

Test it here!


If a full program is required, 17 bytes:

disp(1:input('')) 10 1 2 3 4 5 6 7 8 9 10 

Test it here!

#MATLAB, 7 bytes

An unnamed anonymous function:

@(n)1:n 

Run as:

ans(10) ans = 1 2 3 4 5 6 7 8 9 10 

If a full program is required, 17 bytes:

disp(1:input('')) 10 1 2 3 4 5 6 7 8 9 10 

#MATLAB, 7 bytes

An unnamed anonymous function:

@(n)1:n 

Run as:

ans(10) ans = 1 2 3 4 5 6 7 8 9 10 

Test it here!


If a full program is required, 17 bytes:

disp(1:input('')) 10 1 2 3 4 5 6 7 8 9 10 

Test it here!

added 13 characters in body
Source Link
Stewie Griffin
  • 46.8k
  • 16
  • 140
  • 304

#MATLAB, 7 bytes

An unnamed anonymous function:

@(n)1:n 

Run as:

ans(10) ans = 1 2 3 4 5 6 7 8 9 10 

If a full program is required, 17 bytes:

disp(1:input('')) 10 1 2 3 4 5 6 7 8 9 10 

#MATLAB, 7 bytes

An unnamed anonymous function:

@(n)1:n ans(10) ans = 1 2 3 4 5 6 7 8 9 10 

If a full program is required, 17 bytes:

disp(1:input('')) 10 1 2 3 4 5 6 7 8 9 10 

#MATLAB, 7 bytes

An unnamed anonymous function:

@(n)1:n 

Run as:

ans(10) ans = 1 2 3 4 5 6 7 8 9 10 

If a full program is required, 17 bytes:

disp(1:input('')) 10 1 2 3 4 5 6 7 8 9 10 
Source Link
Stewie Griffin
  • 46.8k
  • 16
  • 140
  • 304
Loading