octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Matlab compatability for strtrim


From: Michael D Godfrey
Subject: Re: Matlab compatability for strtrim
Date: Sat, 23 Jul 2011 08:50:49 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110707 Thunderbird/5.0

On 07/23/2011 08:12 AM, Rik wrote:
Michael,

Can you try the following to see how it handles char arrays?

s = strtrim ([" abc   "; "      d "]

size (s)

Regards,
Rik
After a bit of adjustment, I got (Matlab R2009B):

>> s = strtrim ([' abc    '; '      d '])

s =

abc
     d

>> size(s)

ans =

     2     6

>>
==================
The needed "adjustments" were:
1. Single '
2. Remove one blank from ' abc ' to make it match the other string length.
    Blank removed followed the abc .
3. Add closing ).
==================

It seems more reasonable to use Linux interpretation of "space." But, someone
should check on what some version of Windows thinks.  There probably is an
official standard, but I would have to check on that. Also, the Linux answer may
depend on which LANG is set.

Michael



reply via email to

[Prev in Thread] Current Thread [Next in Thread]