01-22-2021 12:08 AM
I have a 2d array pf 360x360
with a good and proper image forming
now I used this to normalize that array so it comes b/w 0 and 1 and not <0
whereas it is giving values <0
original matrix don't have any -ve values
Solved! Go to Solution.
01-22-2021 12:50 AM - edited 01-22-2021 12:54 AM
Hi gpt,
you are starting one thread after the other, but you fail to take advice (aka "fail to learn from suggestions") as given here.
Please cleanup code before posting!
Please provide real code instead of images of code!
Please provide code with example data included!
@gptshubham595 wrote:
now I used this to normalize that array so it comes b/w 0 and 1 and not <0
Why do you use a matrix function when you want to use a simple InRangeAndCoerce operation???
Or do you want to calculate simple math like
y = (x - min(x))/(max(x) - min(x))
with y and x being 2D arrays?
After taking basic LabVIEW training you should have heard of polymorphism…
01-22-2021 01:16 AM - edited 01-22-2021 01:25 AM
Yes for sure I'm trying to learn and get basic training of LabVIEW!
Being a bit new to this makes
from normalization I mean
summation of all elements of a row and divide each element with this sum
like
1 2 3 = 1+ 2 +3 =6 =>1/6 , 2/6 , 3/6
4 5 6 = 4+ 5 +6 =15 =>4/15 , 5/15 , 6/15
7 8 9
01-22-2021 01:25 AM
Hi gpt,
@gptshubham595 wrote:
from normalization I mean
summation of all elements of a row and divide each element with this sum
Use an autoindexing FOR loop to iterate of the rows of your 2D array.
Inside the loop you calculate the sum of the row (ArraySum) and divide the row by that sum
Then output the scaled row values using an autoindexing tunnel to get the resulting "normalized" 2D array…
Pretty basic stuff involving loops, autoindexing, polymorphism.
Did you take the basic Training resources as offered in the header of the LabVIEW board?
01-22-2021 01:26 AM - edited 01-22-2021 01:29 AM
I know this method, and solved by this
but thought that is it not possible with a single builtin VI?
Thank you for valuable suggestions
oh! will follow that
till now I was following youtube 😅
01-22-2021 08:27 AM
If you could do everything with a single built-in VI, there'd be no reason to ever program anything.
I don't trust youtube videos for LabVIEW. Many of the videos I see are of poor quality, you can't understand the speaker, and they promote poor programming practices.