Path: news.mathworks.com!not-for-mail
From: "Dan Haeg" <haegd@msoe.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Extract an alphabet from a string?
Date: Tue, 22 Apr 2008 22:07:01 +0000 (UTC)
Organization: Milwaukee School of Engineering
Lines: 21
Message-ID: <fulni5$21p$1@fred.mathworks.com>
References: <fulk7c$7uv$1@fred.mathworks.com>
Reply-To: "Dan Haeg" <haegd@msoe.edu>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1208902021 2105 172.30.248.37 (22 Apr 2008 22:07:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 22 Apr 2008 22:07:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 475291
Xref: news.mathworks.com comp.soft-sys.matlab:464642



"John Chow" <nospam@mathworks.com> wrote in message
<fulk7c$7uv$1@fred.mathworks.com>...
> How can I extract an alphabet from a string?  For example, 
> I have a string
> 
> StrVar = 'abcde'
> 
> How can I extract the 2nd alphabet (which is 'b') from the 
> string?  I remember that I was able to do it with 
> QuickBasic sometime ago but cannot find the comparable 
> command in Matlab.
> 
> Thanks.
> 
> John

StrVar == char(98)

or

StrVar == 'b'