General
How to check if a singleton exists in a vector
Started by Softcore on .
Sign in or create an account to join the conversation.
I have a randomely produced integer value i that returns me an element A of a vector V with 12 elements (floating numbers).
decl i=round(rand()*11);
decl A=V;
How can I then "check" if the value A exists inside another vector K?
Any suggestions?
decl i=round(rand()*11);
decl A=V;
How can I then "check" if the value A exists inside another vector K?
Any suggestions?
Not sure if there is a dedicated function for this but i would just loop through it.
Hear ya! Thanks for the reply....I found a workaround to what I wanted to achieve so all is well.
Hi
Figured you would sort something out ..
This has come up before - there is stuff in SLVector that would help
Various ways tp approach it on whether you want just whether it there, or where it is etc
A==K should return array of 0,1 on whether there is match
so sumof(A==K)>0 will return 0/1 if it matches . . .
Cheers
MM
Figured you would sort something out ..
This has come up before - there is stuff in SLVector that would help
Various ways tp approach it on whether you want just whether it there, or where it is etc
A==K should return array of 0,1 on whether there is match
so sumof(A==K)>0 will return 0/1 if it matches . . .
Cheers
MM