Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matlab Function in Simulink

  1. Jul 21, 2013 #1
    Hello everyone!
    In Simulink , I use the Embedded MATLAB Function

    function out = fcn(meas)

    if meas>10
    out = 4;
    elseif meas<=0
    out=2;
    end

    And I get this message:
    Output argument 'out' is not assigned on some execution paths.

    I would like the variable 'out' to change its value only if either of these conditions is true.
    So I guess I have to give 'out' an initial value that is valid only for the first cycle of the program.
    Does anyone know how I can do that?

    Thanks!
     
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted



Similar Discussions: Matlab Function in Simulink
  1. Matlab input function (Replies: 0)

  2. Matlab cell functions (Replies: 0)

Loading...