diff options
| author | Gustav Sörnäs <gusso230@student.liu.se> | 2019-11-25 12:34:32 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gusso230@student.liu.se> | 2019-11-25 12:34:32 +0100 |
| commit | 2246ff7466c252dff4e22ed894dee3f152f0f4e1 (patch) | |
| tree | 93413bd113aac4d16a4713ed2e2d879ecc692ee8 /Kod/bilbana/yc4/clamp.m | |
| parent | 28de2319217341f7dd2ce8b8ecc091328a60eeaa (diff) | |
| download | tfyy51-2246ff7466c252dff4e22ed894dee3f152f0f4e1.tar.gz | |
Changes
- Add semicolons
- Fix clamp
- Fix syntax
- Make testing (somewhat) modular
Diffstat (limited to 'Kod/bilbana/yc4/clamp.m')
| -rw-r--r-- | Kod/bilbana/yc4/clamp.m | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Kod/bilbana/yc4/clamp.m b/Kod/bilbana/yc4/clamp.m index 97d21a5..78ddedd 100644 --- a/Kod/bilbana/yc4/clamp.m +++ b/Kod/bilbana/yc4/clamp.m @@ -1,6 +1,6 @@ -function val = clamp(m, n, M) +function val = clamp(n, m, M) % returns n if n is between m and M, otherwise % m if n < m % M if n > m -val = min(max(m, n), N) +val = min(max(n, m), M); end |
