- #1
Sirsh
- 267
- 10
Hey all,
I need your help writing the meat of a function that I need for a MATLAB script I'm writing.
The jist of it is, starting from 0°, when between 0.0° - 5.0° apply a certain value, when between 5.0° - 15.0° apply another value. However, the relative amount of rotation can be user defined, so I cannot make predefined matrices. The upper and lower limits are absolute, but the intervals within them should be able to be any size.
I thought it would be possible through a if else statement, but I cannot figure out how to make the condition of the statement applicable to what I've stated above. As if the user input rotation is 360°, value 'A' would be applied at 0°-5°, 15°-20° 30°-35° and value 'B' would be applied at 5°-15°, 20°-30°, 35°-45° etc.
Any help would be appreciated, it's probably cake for you seasoned programmers!
I need your help writing the meat of a function that I need for a MATLAB script I'm writing.
The jist of it is, starting from 0°, when between 0.0° - 5.0° apply a certain value, when between 5.0° - 15.0° apply another value. However, the relative amount of rotation can be user defined, so I cannot make predefined matrices. The upper and lower limits are absolute, but the intervals within them should be able to be any size.
I thought it would be possible through a if else statement, but I cannot figure out how to make the condition of the statement applicable to what I've stated above. As if the user input rotation is 360°, value 'A' would be applied at 0°-5°, 15°-20° 30°-35° and value 'B' would be applied at 5°-15°, 20°-30°, 35°-45° etc.
Any help would be appreciated, it's probably cake for you seasoned programmers!