The easiest way to perform a numerical computation in NetSolve is to call the function netsolve(). With this function, the user sends a blocking request to NetSolve. By blocking we mean that after typing the command in the Matlab session, the user resumes control only when the computation has been successfully completed on a server. The other way to perform computation is to send a nonblocking request as described in the section called Calling netsolve_nb().
Let us continue with the eig example we started to develop in the preceding section. The user now knows that he has to provide a double-precision square matrix to NetSolve, and he knows that he is going to get two real vectors back (or one single complex vector). He first creates a 300 × 300 matrix, for instance,
>> a = rand(300); |
>> [x y] = netsolve('eig',a) |
Let us see what happens when we type:
>> [x y] = netsolve('eig',a) Sending Input to Server zoot.cs.utk.edu Downloading Output from Server zoot.cs.utk.edu x = y = 10.1204 0 -0.9801 0.8991 -0.9801 -0.8991 -1.0195 0 -0.6416 0.6511 ... ... ... ... |
As mentioned earlier, the user can decide to regroup x and y into one single complex vector. Let us make it clear again that this possibility is a specificity of eig and is not available in general for all problems. To merge x and y, the user has to type:
>> [x] = netsolve('eig',a) Sending Input to Server zoot.cs.utk.edu Downloading Output from Server zoot.cs.utk.edu x = 10.1204 -0.9801 + 0.8991i -0.9801 - 0.8991i -1.0195 -0.6416 + 0.6511i ......... ......... |