08-21-2005 05:51 PM
08-22-2005 12:03 AM
The m files does run in MATLAB because you have previously defined "banana" in MATLAB workspace. This error ecrtainly is not caused by LV. you should define all variables and functions in the script node.I think the problem comes from m file.
This is a part of MATLAB help file:
starts at the point x = fminsearch(fun,x0) x0 and finds a local minimum x of the function described in fun. x0 can be a scalar, vector, or matrix. fun is a function handle. See Function Handles in the MATLAB Programming documentation for more information.
Actually, I can't understand what fminsearch is supposed to do here!
08-22-2005 04:32 PM
08-22-2005 04:43 PM
08-23-2005 03:47 AM
Oh, this 'banana' here is the banana's rosenbrock function. I was mistaking to interpret it as a variable. have you made an m file containing
function f = banana(x)
f = 100*(x(2)-x(1)^2)^2+(1-x(1))^2;
with the name of banana.m in Current MATLAB's working directory?
attached, you'll find the modified working version
. remember that you must have banana.m in you working directory of MATLAB.
08-23-2005 06:07 AM
Hi, do you mind to save another one in 7.0 version?
many thanks
08-23-2005 06:24 AM
08-23-2005 01:11 PM
Soroush,
The vi did not work for me. i had my m file placed in the matlab working directory.still return me the error 1050.i wonder where went wrong?
Beside that can you advise why you did not declare an input in the node? From the Lorenz differential example it did convert the file to string then string to array etc...
08-23-2005 02:01 PM
zero. So whatever the initial state is, we will have a very small number as the result for fval and a vector with two elements so close to 1, as x.
If there is still any dark point let me know. why and how do you want to relate Lorenz differential eq. to this script node? can you give a wider image of the main problem?
08-28-2005 03:09 PM
Hi sorry for the late reply, the script works well now.
The Lorenz DE was the only example i can find in LV to illustrate the script node.U can see from the example that it actually convert the m file(function inside) to char ,string before input into the node.
My application will be similar to this fminsearch but the banana.m file(the equation) will be created in LV enviroment instead of a m file created in matlab.So how do i call the matlab script.node to do the fminsearch.Do i use write 'the equation' to a spreadsheet file in LV and convert to m.file or can i just input the equation into the input node?