08-10-2021 07:12 AM - edited 08-10-2021 07:19 AM
Hello,
I have a 2D matrix like these:
-1,0,4,-1
8,-3,8,-2
4,2,0,8
2,1,2,5
I would like to convert this array to another array which the maximum value (8) to be 144, and the minimum value (-3) to be 0.
and the other values with the same sequence,
simply i can convert the positive values, but I don't know how to convert the negative values. Like the attached vi
can you help!
Solved! Go to Solution.
08-10-2021 07:18 AM - edited 08-10-2021 07:19 AM
Hi BaJa,
@BaJa_2020 wrote:
I would like to convert this array to another array which the maximum value (8) to be 144, and the minimum value (-3) to be 0.
and the other values with the same sequence,
What "same sequence" are you talking about?
I guess you want to apply a (linear?) scaling to those values in the array: just do so!
The math behind that scaling is rather simple: when you have fnished school then you should know how to do that!
scaled_value := (unscaled_value - unscaled_min) * (scaled_max - scaled_min)/(unscaled_max - unscaled_min) + scaled_min
As most (basic) LabVIEW functions are polymorphic you can directly scale the whole array…