[Scilab-users] Running external program

selieff selieff at sgl.com
Thu Dec 3 15:10:40 CET 2015


The command you want is 'dos':

dos('grd2xyz faa.grd -ZTLa > faa.txt')

If the command line is complex or needs to include names defined elsewhere,
it is sometimes helpful to use msprintf to create the string first

complex_command = msprintf(...)

and then issue it using the string variable

dos(complex_command,'-echo')

The '-echo' is optional but nice to see in the command window.

The resulting 'faa.txt' file from GMT can be read with whatever function
makes the most sense for the format (fscanfMat perhaps?).

Stefan



arctica1963 wrote
> Hello,
> 
> I have the windows version of Scilab (currently 5.4.1), but would like
> to run an external program (e.g. gmt software) and return or use the
> output in the Scilab code:
> 
> As a rough algorithm  example (.sce):
> 
> //run the gmt program grdinfo.exe - extract data as single column
> z-matrix)
> 
> grd2xyz faa.grd -ZTLa > faa.txt
> 
> scilab: assign matrix output to variable for use in Scilab etc.
> 
> Any pointers would be helpful.
> 
> Lester
> _______________________________________________
> users mailing list

> users at .scilab

> http://lists.scilab.org/mailman/listinfo/users





--
View this message in context: http://mailinglists.scilab.org/Scilab-users-Running-external-program-tp4033159p4033160.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.



More information about the users mailing list