help-octave
[Top][All Lists]
Advanced

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

handling strings


From: Mike Miller
Subject: handling strings
Date: Mon, 12 Sep 2005 18:38:01 -0500 (CDT)

This is a seemingly simple problem but I find it hard to deal with in Octave (probably because there is some neat trick that I don't know). Here is the bare bones of it:

I have a file with strings delimited by any number of consecutive spaces and/or tabs. The line may be padded with some spaces or tabs at either end that should be ignored. I want to be able to read in the file as an array of strings. Is that even possible?

Once I have the data in memory, I want to be able to find the array elements containing strings that match other strings in the array. Let's call the array "A". I would then want to do things like

find(A==A(2,3))

It seems that Octave and MATLAB normally like to store strings as vectors, which kinda messes up my scheme.

We're working on a C++ program to be used as a .oct file, but I'd like to understand how to do this within Octave anyway, if it is possible for Octave to do this kind of string handling.

Mike

--
Michael B. Miller, Ph.D.
Assistant Professor
Division of Epidemiology and Community Health
and Institute of Human Genetics
University of Minnesota
http://taxa.epi.umn.edu/~mbmiller/



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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