[kepler-users] Matlab expression actor

Michael Hernandez mherna48 at uiuc.edu
Wed Mar 4 08:59:27 PST 2009


Hi All,

I'm still having trouble with the matlab expression actor. I wrote a code in
Matlab, that I'd like to run in Kepler, that calls on other files within the
Current Directory. I'd like to get two outputs from my code, so I configured
two output ports from the Matlab actor of type double. The output it gives
me is the same as the initialized variables I set in the code. The
conclusion I came up with is either a) the Current Directory is not set
correctly in Kepler, b) it's not running through the While loop I have in my
code, or c) the matlab actor in Kepler can't pass variables correctly
between functions. Here is the code that I put into the matlab expression
actor in Kepler:

---------------------------------------------------------------------------------------------------------
clear all;
warning off;
global count ;

X_ALL(1:14) = 5 ;
X_SUB1(1:5) = 5 ;
X_SUB2(1:5) = 5 ;
X_OLD = X_ALL + 1 ;

save X_SUB1.mat X_SUB1 ;
save X_SUB2.mat X_SUB2 ;
count=1;

while ( (norm(X_OLD - X_ALL) > 0.001) )

    X_OLD = X_ALL ;

    for i = 1:3
        switch i
          case 1
             [result X_ALL] = sys_s(X_ALL);
          case 2
             [result X_ALL] = subsys1_s(X_ALL);
          case 3
             [result X_ALL] = subsys2_s(X_ALL);
          otherwise
             result = 0;
             X_ALL = X_ALL;
        end
    end
    count = count + 1 ;
end

X_SUB1 = [ X_ALL(3) X_ALL(8)   X_ALL(9)   X_ALL(10)  X_ALL(11) ]
X_SUB2 = [ X_ALL(6) X_ALL(11) X_ALL(12)  X_ALL(13) X_ALL(14) ]

save X_SUB1.mat X_SUB1 ;
save X_SUB2.mat X_SUB2 ;

------------------------------------------------------------------------------------------------------------------------

And what I'd like to output from the code is the modified X_SUB1 & X_SUB2 at
the end. But in Kepler, the display shows X_SUB1(1:5) = 5  &  X_SUB2(1:5) =
5 ; which is what was initialized at the top.

Another question I have is: Is there a newer version of Kepler, or is the
nightly build just the newer version??

Thanks for the help,

-- 
Michael Hernandez
University of Illinois - Electrical Engineering
SHPE | UIUC Alumni Relations Chair
Cell#: 847-736-3889
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nceas.ucsb.edu/kepler/pipermail/kepler-users/attachments/20090304/53c1128e/attachment.html>


More information about the Kepler-users mailing list