Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 462215

Submitted on 25 Jun 2014 by Ziko

Correct

54Size
Leading solution size is 10.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Pass
 
%%
n = 200;
y_correct = [11 22 33 44 55 66 77 88 99 101 111 121 131 141 151 161 171 181 191];
assert(isequal(palin(n),y_correct))
y =
    11
y =
    11    22
y =
    11    22    33
y =
    11    22    33    44
y =
    11    22    33    44    55
y =
    11    22    33    44    55    66
y =
    11    22    33    44    55    66    77
y =
    11    22    33    44    55    66    77    88
y =
    11    22    33    44    55    66    77    88    99
y =
    11    22    33    44    55    66    77    88    99   101
y =
    11    22    33    44    55    66    77    88    99   101   111
y =
    11    22    33    44    55    66    77    88    99   101   111   121
y =
    11    22    33    44    55    66    77    88    99   101   111   121   131
y =
    11    22    33    44    55    66    77    88    99   101   111   121   131   141
y =
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151
y =
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Column 17
   171
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 18
   171   181
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 19
   171   181   191
2
Pass
 
%%
n = 400;
y_correct = [11 22 33 44 55 66 77 88 99 101 111 121 131 141 151 161 171 181 191 202 212 222 232 242 252 262 272 282 292 303 313 323 333 343 353 363 373 383 393];
assert(isequal(palin(n),y_correct))
y =
    11
y =
    11    22
y =
    11    22    33
y =
    11    22    33    44
y =
    11    22    33    44    55
y =
    11    22    33    44    55    66
y =
    11    22    33    44    55    66    77
y =
    11    22    33    44    55    66    77    88
y =
    11    22    33    44    55    66    77    88    99
y =
    11    22    33    44    55    66    77    88    99   101
y =
    11    22    33    44    55    66    77    88    99   101   111
y =
    11    22    33    44    55    66    77    88    99   101   111   121
y =
    11    22    33    44    55    66    77    88    99   101   111   121   131
y =
    11    22    33    44    55    66    77    88    99   101   111   121   131   141
y =
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151
y =
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Column 17
   171
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 18
   171   181
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 19
   171   181   191
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 20
   171   181   191   202
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 21
   171   181   191   202   212
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 22
   171   181   191   202   212   222
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 23
   171   181   191   202   212   222   232
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 24
   171   181   191   202   212   222   232   242
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 25
   171   181   191   202   212   222   232   242   252
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 26
   171   181   191   202   212   222   232   242   252   262
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 27
   171   181   191   202   212   222   232   242   252   262   272
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 28
   171   181   191   202   212   222   232   242   252   262   272   282
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 29
   171   181   191   202   212   222   232   242   252   262   272   282   292
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 30
   171   181   191   202   212   222   232   242   252   262   272   282   292   303
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 31
   171   181   191   202   212   222   232   242   252   262   272   282   292   303   313
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 32
   171   181   191   202   212   222   232   242   252   262   272   282   292   303   313   323
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 32
   171   181   191   202   212   222   232   242   252   262   272   282   292   303   313   323
  Column 33
   333
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 32
   171   181   191   202   212   222   232   242   252   262   272   282   292   303   313   323
  Columns 33 through 34
   333   343
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 32
   171   181   191   202   212   222   232   242   252   262   272   282   292   303   313   323
  Columns 33 through 35
   333   343   353
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 32
   171   181   191   202   212   222   232   242   252   262   272   282   292   303   313   323
  Columns 33 through 36
   333   343   353   363
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 32
   171   181   191   202   212   222   232   242   252   262   272   282   292   303   313   323
  Columns 33 through 37
   333   343   353   363   373
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 32
   171   181   191   202   212   222   232   242   252   262   272   282   292   303   313   323
  Columns 33 through 38
   333   343   353   363   373   383
y =
  Columns 1 through 16
    11    22    33    44    55    66    77    88    99   101   111   121   131   141   151   161
  Columns 17 through 32
   171   181   191   202   212   222   232   242   252   262   272   282   292   303   313   323
  Columns 33 through 39
   333   343   353   363   373   383   393