<< NL_F_MatrixSize NL_F: Function NL_F_NLPath >>

NARVAL >> NL_F: Function > NL_F_Mysql2Scilab

NL_F_Mysql2Scilab

Perform a Mysql command from Scilab (Unix/Ubuntu).

Calling Sequence

[M] = NL_F_Mysql2Scilab(D,T,U,passwd,q)

Arguments

D :

Database.

T :

Table.

U :

Username.

P :

Password.

Q :

Query.

M :

Matrix.

Description

NL_F_Mysql2Scilab performs the Mysql query Q on the Table T of the Database D. The result is stored inside the matrix M. It is assumed that the user environment is Linux (e.g. Ubuntu) and that Perl and Mysql are already installed. The script "/NARVAL/demos/PCH2010/Mysql2Scilab.pl" enables the data extraction. The user can also install PhPMyAdmin for an easier management ("sudo apt-get install phpmyadmin"). In the following example, we assume that we have a database "PCH2010" composed by 30 columns ("LOOPID","VEHICULETYPE","DATE","DIRECTION","DAY","N1","N2","N3","N4","N5","N6","N7","N8","N9","N10","N11","N12","N13","N14","N15","N16","N17","N18","N19","N20","N21","N22","N23","SUM","AVG") coming from a traffic monitoring architecture based on magnetic loop counters. A part of this database (50 entries) can be found in /NARVAL/demos/PCH2010.

Examples

[path]=NL_F_NLPath();//path to NARVAL module
path=path+'/demos/';//folder path
//the database D4D and its table PCH2010 are assumed to be already set up on the user computer
db="D4D";
sq="PCH2010";
uname="root";
passwd="";
q='SELECT * FROM `PCH2010` WHERE `DATE`=2 and `VEHICULETYPE`=2 and `DIRECTION`=1';
//q=SELECT * FROM `PCH2010` WHERE `DATE`=0 and `VEHICULETYPE`=1 and `DIRECTION`=1';
[M]=NL_F_Mysql2Scilab(db,sq,uname,passwd,q);//application of NL_F_Mysql2Scilab

Report an issue
<< NL_F_MatrixSize NL_F: Function NL_F_NLPath >>