title: Extract substring from the last position in Matlab
body: <p>I have got this one:</p>
  
  <pre><code>string = 'abcdefgh'
  string(1:3) = 'abc'
  </code></pre>
  
  <p>Is this possible <code>string(-6:1) = 'abcdef'</code> .</p>
  
  <p>I know this is not possible , what is the closest that is possible ; something which is similar to Python substring syntax.</p>
  
  <p>Edit : I want to get rid of <code>.jpg</code>and <code>C:\</code> from <code>C:/hello.jpg</code>to get just <code>hello</code> . Using strsplit twice is just cumbersome . I just know the length of <code>C:\</code> and <code>.jpg</code>, but not of the whole string.</p>