Reputation: 261
I want to restrict the variable that I use as input for a matlab function block, it must be only able to increase. To achieve that i have tried to compare the variable and the previous sample of it in a matlab function, but i don't know how to create two inputs. To solve that i've tried to use a mux, but then i get an error. And google doesn't give me an explanation how to use a mux signal as input for a matlab function. So that leaves me here with this low-level question. Thanks in advance for your help and time. Cheers.
Upvotes: 1
Views: 9467
Reputation: 68
To use multiple variables in a function, you need to modify your function declaration at the first line of your function. The reference syntax is:
function [y1,...,yN] = myfun(x1,...,xM)
where x1 through xM are inputs. Your declaration with two inputs might look something like:
function [returnValue] = hasIncreased(previousSample, variable)
See the Matlab Function Documentation for more information.
Upvotes: 2