02-12-2018 07:44 AM
I need to develop a structure on the following condition: where when value of n changes, t should display a value as given below.
N ranges from 100 to 1000
T ranges from 35-150
if N>900, T=35
if N>800 and <900, T=40
if N>700 and <800, T=50
if N>600 and <700, T=60
if N>500 and <600, T=70
if N>400 and <500, T=80
if N>300 and <400, T=90
if N>200 and <300, T=120
if N>100 and <200, T=150
Solved! Go to Solution.
02-12-2018 08:19 AM - edited 02-12-2018 08:23 AM
Basic answer: use a Case Structure with as many different cases as you need.
Also: your specifications overlooks multiples of 100; what if N = 400, for example?
Once you defined these intermediate cases, you may also divide N by 100 and use the result to index an array containing the output values.
02-12-2018 08:22 AM
I'm very new to this field, can you provide an example?
02-12-2018 08:25 AM
if n=400 t=80
02-12-2018 08:30 AM - edited 02-12-2018 08:31 AM
Personally, I am a fan of using Threshold 1D Array for situations like this. You get a fractional index, so round down, and then use Index Array to get your T value.
02-12-2018 08:34 AM
Thank you for helping me