[Scilab-users] Running external program

Stefan Elieff selieff at sgl.com
Thu Dec 3 14:57:05 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


On 2015-12-03 6:43 AM, Lester Anderson 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 lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>



More information about the users mailing list