Re: Is there a way to trim text in Matlab?



PB wrote:
>
>
> OA wrote:
>>
>>
>> Could anyone tell me if there is a function which would allow
one
>> to
>> take part of a string somehow.
>>
>> For instance, let's say I have:
>>
>> a = 'redcar'
>>
>> and I'd like b to be 'red', is there something like:
>>
>> b=left(a,3)
>>
>> in Matlab or some similar function which would allow me to do
> this?
>
> One ML way is to use indexing:
>
> b=a(1:3)
> c=a(4:end)
>
> HTH
>
> PB
Thank you very much. That's exactly what i was looking for.

-OA
.



Relevant Pages

  • Re: Troubles in C land
    ... to do it in matlab, use ind2sub: ... HTH ... Prev by Date: ...
    (comp.soft-sys.matlab)
  • Re: Matlab "Zero" Problem
    ... > Matlab does not like && at that place. ... > idea to spare? ... Prev by Date: ...
    (comp.soft-sys.matlab)
  • Re: Determining whether toolbox is installed
    ... > Is there a way to figure out whether a machine has a certain Matlab ... HTH, ... Amanda ... Prev by Date: ...
    (comp.soft-sys.matlab)
  • Re: Getting Help
    ... K. Bakkar wrote: ... > I am new to Matlab therefore, I am asking which is the best ... HTH ... Prev by Date: ...
    (comp.soft-sys.matlab)
  • Re: Is there a way to trim text in Matlab?
    ... > take part of a string somehow. ... One ML way is to use indexing: ... HTH ... Prev by Date: ...
    (comp.soft-sys.matlab)