Обсуждение: MATLAB mex file interface

Поиск
Список
Период
Сортировка

MATLAB mex file interface

От
"G. Anthony Reina"
Дата:
Has anyone ever tried creating a MATLAB mex file (UNIX-based) to access
the PostgreSQL database from MATLAB?

-Tony Reina



Re: [PORTS] MATLAB mex file interface

От
"Michael A. Koerber SR"
Дата:
> Has anyone ever tried creating a MATLAB mex file (UNIX-based) to access
> the PostgreSQL database from MATLAB?
>
> -Tony Reina

I don't know, but Matlab does have a database access toolbox that you
might check out.

For my work, I just use a matlab shell command and PSQL.  E.g.,

> % Create command
> cmd = sprintf('!psql -d %s %s -c "%s" > %s', Data_Base_Name, PSQ_OPTIONS, SQL_command, Temp_File_Name);
> eval(cmd)
> cmd = sprintf('my_data = load(%s)',Temp_File_Name);
> eval(cmd)
>
> % Now work with the data in my_data...

Just pick the right options to get the type of delimiting you want.  In some cases
I've created Perl Scripts (functions) which are called using Pg.pm...but these
are tougher problems than a simple "select" command, perhaps joins and such.

I feel this is the quickest and lowest cost solution...unless a MEX file is ready
for download...


mike

--
Dr Michael A. Koerber
MIT/LL
Radar Imaging Techniques

Re: [PORTS] MATLAB mex file interface

От
"G. Anthony Reina"
Дата:
Michael A. Koerber SR wrote:

> I don't know, but Matlab does have a database access toolbox that you
> might check out.
>

Yes, I know of the toolbox. Right now, though, it only works in a MS Windows environment. They will probably
port it to Solaris but not anytime soon.

I had not though of using the 'psql -c' command directly from MATLAB. That seems like a good idea.

Thanks.
-Tony Reina