Create a two variables function, including several law in MATLAB

1 view (last 30 days)
la
la on 18 Jun 2015
Commented: la on 19 Aug 2015
Dear Mathworks team
Hello
Please guide me. I searched in the FAQ and the Internet, but could not find answer for my question.
I want to create a two variables function, including several law in MATLAB. Then, I want to import code into C#.(I need the output of this function for C#)
How can I create this function
Thank you in advance for your attention and answer

Accepted Answer

B.k Sumedha
B.k Sumedha on 18 Jun 2015
  5 Comments

Sign in to comment.

More Answers (1)

Walter Roberson
Walter Roberson on 19 Jun 2015
21<x2<=27 is parsed as
((21<x2)<=27)
In the first step, 21<x2 returns a logical value, 0 or 1. In the second step, that 0 or 1 is compared <= 27. 0 and 1 are always <= 27 so the overall test would always be true.
If you want to test whether a value is in a range, write it as two tests:
21<x2 & x2 <= 27

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!