Skip to main content
deleted 9 characters in body
Source Link
Abr001am
  • 930
  • 7
  • 17

let me include my matlab version

MATLAB 266 (265267 b)

function d=p(V,a),j=(a==1|a==numelj=numel(V)-1);if1;if (a==0),d=0;return; end,d=(V(a)-48+10*p(V,a-1))*(V(a)<64);fprintf('%c%.*s%c%.*s',j*10(a>=j)*10,j*eval(a==j|a==1)*eval(strcat(regexprep(V,'[NP]','+'),48)),ones(99)*'_',(j|a==2a<3)*10,(V(a+1)>64)*d,repmat((V(a+1)==78)*'=='+(V(a+1)==80)*'- ',[1 99]));end

input

An ascii-formatted string tailed by a space (since there is no end of chain '\0' in matlab

example V='12N13P '


output

pattern representation of the road

_________________________ 


============- - - - - - - 

_________________________

function

the function must be called from its tail-1 (the empty character is removed)

example : p(V,numel(V)-1)

Simulation

try it online here

let me include my matlab version

MATLAB 266 (265 b)

function d=p(V,a),j=(a==1|a==numel(V)-1);if (a==0),d=0;return; end,d=(V(a)-48+10*p(V,a-1))*(V(a)<64);fprintf('%c%.*s%c%.*s',j*10,j*eval(strcat(regexprep(V,'[NP]','+'),48)),ones(99)*'_',(j|a==2)*10,(V(a+1)>64)*d,repmat((V(a+1)==78)*'=='+(V(a+1)==80)*'- ',[1 99]));end

input

An ascii-formatted string tailed by a space (since there is no end of chain '\0' in matlab

example V='12N13P '


output

pattern representation of the road

_________________________

============- - - - - - -
_________________________

function

the function must be called from its tail-1 (the empty character is removed)

example : p(V,numel(V)-1)

Simulation

try it online here

let me include my matlab version

MATLAB (267 b)

function d=p(V,a),j=numel(V)-1;if (a==0),d=0;return; end,d=(V(a)-48+10*p(V,a-1))*(V(a)<64);fprintf('%c%.*s%c%.*s',(a>=j)*10,(a==j|a==1)*eval(strcat(regexprep(V,'[NP]','+'),48)),ones(99)*'_',(a<3)*10,(V(a+1)>64)*d,repmat((V(a+1)==78)*'=='+(V(a+1)==80)*'- ',[1 99]));end

input

An ascii-formatted string tailed by a space (since there is no end of chain '\0' in matlab

example V='12N13P '


output

pattern representation of the road

_________________________ 


============- - - - - - - 

_________________________

function

the function must be called from its tail-1 (the empty character is removed)

example : p(V,numel(V)-1)

Simulation

try it online here

added 5 characters in body
Source Link
Abr001am
  • 930
  • 7
  • 17

let me include my matlab version

MATLAB 266 (258265 b)

function d=p(V,a),j=(a==1|a==numel(V)-1);if (a==0),d=0;return; end,d=(V(a)-48+10*p(V,a-1))*(V(a)<64);fprintf('%c%.*s%c%.*s',j*10,j*eval(strcat(regexprep(V,'[NP]','+'),48)),ones(99)*'_',j*10(j|a==2)*10,(V(a+1)>64)*d,repmat((V(a+1)==78)*'=='+(V(a+1)==80)*'- ',[1 99]));end

input

An ascii-formatted string tailed by a space (since there is no end of chain '\0' in matlab

example V='12N13P '


output

pattern representation of the road

_________________________

============- - - - - - -
 
_________________________

function

the function must be called from its tail-1 (the empty character is removed)

example : p(V,numel(V)-1)

Simulation

try it online here

let me include my matlab version

MATLAB 266 (258 b)

function d=p(V,a),j=(a==1|a==numel(V)-1);if (a==0),d=0;return; end,d=(V(a)-48+10*p(V,a-1))*(V(a)<64);fprintf('%c%.*s%c%.*s',j*10,j*eval(strcat(regexprep(V,'[NP]','+'),48)),ones(99)*'_',j*10,(V(a+1)>64)*d,repmat((V(a+1)==78)*'=='+(V(a+1)==80)*'- ',[1 99]));end

input

An ascii-formatted string tailed by a space (since there is no end of chain '\0' in matlab

example V='12N13P '


output

pattern representation of the road

_________________________

============- - - - - - -
 
_________________________

function

the function must be called from its tail-1 (the empty character is removed)

example : p(V,numel(V)-1)

Simulation

try it online here

let me include my matlab version

MATLAB 266 (265 b)

function d=p(V,a),j=(a==1|a==numel(V)-1);if (a==0),d=0;return; end,d=(V(a)-48+10*p(V,a-1))*(V(a)<64);fprintf('%c%.*s%c%.*s',j*10,j*eval(strcat(regexprep(V,'[NP]','+'),48)),ones(99)*'_',(j|a==2)*10,(V(a+1)>64)*d,repmat((V(a+1)==78)*'=='+(V(a+1)==80)*'- ',[1 99]));end

input

An ascii-formatted string tailed by a space (since there is no end of chain '\0' in matlab

example V='12N13P '


output

pattern representation of the road

_________________________

============- - - - - - -
_________________________

function

the function must be called from its tail-1 (the empty character is removed)

example : p(V,numel(V)-1)

Simulation

try it online here

added 188 characters in body
Source Link
Abr001am
  • 930
  • 7
  • 17

let me include my matlab version

MATLAB 266 (258 b)

function d=p(V,a),j=(a==1|a==numel(V)-1);if (a==0),d=0;return; end,d=(V(a)-48+10*p(V,a-1))*(V(a)<64);fprintf('%c%.*s%c%.*s',j*10,j*eval(strcat(regexprep(V,'[NP]','+'),48)),ones(99)*'_',j*10,(V(a+1)>64)*d,repmat((V(a+1)==78)*'=='+(V(a+1)==80)*'- ',[1 99]));end

input

An ascii-formatted string tailed by a space (since there is no end of chain '\0' in matlab

example V='12N13P '


output

pattern representation of the road

_________________________

============- - - - - - -

_________________________

function

the function must be called from its tail-1 (the empty character is removed)

example : p(V,numel(V)-1)

Simulation

try it online here

let me include my matlab version

MATLAB 266 (258 b)

function d=p(V,a),j=(a==1|a==numel(V)-1);if (a==0),d=0;return; end,d=(V(a)-48+10*p(V,a-1))*(V(a)<64);fprintf('%c%.*s%c%.*s',j*10,j*eval(strcat(regexprep(V,'[NP]','+'),48)),ones(99)*'_',j*10,(V(a+1)>64)*d,repmat((V(a+1)==78)*'=='+(V(a+1)==80)*'- ',[1 99]));end

input

An ascii-formatted string tailed by a space (since there is no end of chain '\0' in matlab

example V='12N13P '


output

pattern representation of the road

_________________________

============- - - - - - -

_________________________

function

the function must be called from its tail-1 (the empty character is removed)

example : p(V,numel(V)-1)

let me include my matlab version

MATLAB 266 (258 b)

function d=p(V,a),j=(a==1|a==numel(V)-1);if (a==0),d=0;return; end,d=(V(a)-48+10*p(V,a-1))*(V(a)<64);fprintf('%c%.*s%c%.*s',j*10,j*eval(strcat(regexprep(V,'[NP]','+'),48)),ones(99)*'_',j*10,(V(a+1)>64)*d,repmat((V(a+1)==78)*'=='+(V(a+1)==80)*'- ',[1 99]));end

input

An ascii-formatted string tailed by a space (since there is no end of chain '\0' in matlab

example V='12N13P '


output

pattern representation of the road

_________________________

============- - - - - - -

_________________________

function

the function must be called from its tail-1 (the empty character is removed)

example : p(V,numel(V)-1)

Simulation

try it online here

added 2 characters in body
Source Link
Abr001am
  • 930
  • 7
  • 17
Loading
Source Link
Abr001am
  • 930
  • 7
  • 17
Loading