Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Norbert_B

Proven Zealot

07-08-2010 08:27 AM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Ok, Mike is correct that i should not help you in working out a brute force algorithm 😉

Nevertheless, since it is a demanding request, i give you some hints:

a) Handle it in a recursive way

b) The modulo operation (Quotient&Reminder) is your friend

c) there is a reason why most algorithms do not compute all valid permutations but "roll the dice on it"......

hope this helps,

Norbert

PS: If the amount of valid elements would match the number of elements, this request could be solved fairly nicely with building all permutations on purpose. If there is no such match, rolling the dice is coming much more handy......

Norbert

----------------------------------------------------------------------------------------------------

CEO: What exactly is stopping us from doing this?

Expert: Geometry

Marketing Manager: Just ignore it.

----------------------------------------------------------------------------------------------------

CEO: What exactly is stopping us from doing this?

Expert: Geometry

Marketing Manager: Just ignore it.

GerdW

Knight of NI

07-08-2010 08:28 AM - edited 07-08-2010 08:31 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi all,

recursion in LV9 is a dream...

It's not nice, but seems to work. Open Rec_Perm_Main.vi...

Best regards,

GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO

GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO

Download All

Virus scan in progress. Please wait to download attachments.

MikeS81

Proven Zealot

07-08-2010 08:29 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi John,

the algorithm shouldn't be the problem, you can see an example from Delphi here

http://www.swissdelphicenter.ch/torry/showcode.php?id=1032.

I think the more tricky thing is to make it fast. In LabVIEW you should avoid using string arrays to store the results. Much faster is to write it directly into a file.

Mike

07-08-2010 08:37 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

hi, can you convert for LV v8.2 please?

07-08-2010 08:39 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

cool, can that be used in the matlab window for labview?

-> i'm not to good with the matlab window coding.

GerdW

Knight of NI

07-08-2010 08:41 AM - edited 07-08-2010 08:44 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi John,

"can you convert for LV v8.2 please?"

No, it uses Recursion capability of LV2009... Time to upgrade?

That's the block diagram of the permutation VI:

"String in" is the string converted to an U8 array, "strings out" will be converted back in the main VI... (And the subVI is the VI itself - Recursion!)

Best regards,

GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO

GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO

07-08-2010 08:42 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

ah damn, now i understand the 'its a dream' i thought you meant 'it didn't work in LV9'

no stuck with LV 8.2 for now

07-08-2010 08:55 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

i guess it become a question of which is easier;

Build a recursive vi for lv 8.2

or

Try the sequence idea

I'm sure there is a method in the repeating and holding the already used characters using logic.

MikeS81

Proven Zealot

07-08-2010 09:06 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi John,

you can use the code from Gerd. The only thing you need to do is to load the VI dynamically, then it's possible with recursion.

Mike

07-08-2010 09:17 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

sort of copy and paste? or do i need to download their softwere to see it?

how do you load dynamically - VI run settings?