Intro by vivi07


									Calling Scilab from Excel
This is a demo workkbok to show how to use Thomas Baier's COM server for Scilab from within Excel You have to install the R-Scilab server (currently available from before the sheet will work. The sheets in this workbook demonstrate 3 ways of using the interface DirectTransfer Macros Formulas Direct menu controlled data transfer and Scilab command execution Using macros to transfer data and run Scilab command Worksheet functions calling Scilab

All these demos will only work if you have put scilabproxy.dll in the right place. The menu item DOC- 04 Scilab, Installation, Usage on the Start->R->(D)COM Server menu explains how to do this

1 3 2

2 2 1

3 1 3

Select A1:C3 Click Put on Scilab toolbar Enter m1 for the variable name


Select A6 Click Run on Scilab toolbar

Select A10 Click Get on Scilab toolbar Enter m2 for the expression

Select A15 Click Get on Scilab toolbar Enter inv(m2) for the expression

Matrix MyMat 5 3 3

2 1 1

3 1 2

0.2 2

2 1





3 2 1

-1 -2 -3 1 2


Series1 Series2

Series2 Series1

1 3 #NAME? #NAME? #NAME? #NAME? #NAME? [x1,x2]=spec(mat) x3=x1*x1 #NAME? #NAME? #NAME?

2 5 #NAME? #NAME?

If you see error messages press Ctrl-Shft-Alt-F9 to trigger a complete recalc

For interactive use, there are two Worsheet functions Scilab needs the name of a Scilab function and arguments for these functions Excel then calls the Scilab function with the indicated arguments and puts the result on the worksheet Function calls are automatically recomputed when the arguments change ScilabExec executes a command which does not return a value


3 1 x3 #NAME? #NAME?

1 3 Select A24 enter thee formula =scilab("chol",A21:B22) With cell A24 still selected click Adjust on the Scilab toolbar


function y=f7(x1,x2) a=x1*x1 b=x2*x2 y=a+b endfunction #NAME? 2 3 #NAME?

This is a function definition

ScilabExec executes the function definition Change the function definition and Excel wil recalcula

1+i 4 2i


2 rangeiscomplex(

1 4a


1 0

0 2



1 2 3



sheet functions Scilab function ese functions cilab function uments and puts the result

omatically recomputed

which does not return a value

the function definition definition and Excel wil recalculate

To top