05-25-2024 05:12 AM
Hello! I am trying to master LabVIEW as part of my training and learning new tools. I am trying different tasks with the functionality of the programme. Now I'm trying to work with arrays, but I don't understand why nothing works. Maybe there are some simple solutions for my task? Looked in the forum, but the tasks are too complicated for me to understand. (LabVIEW ver. 6.0.1b3)
My task:
Take all permutations of elements 1, . . . . . 6 .
Solved! Go to Solution.
05-25-2024 05:41 AM
Hi!
The datatype of your output is double. But the matlab code returns a 2D array of integer values, so the output should be a 2D array of I32 or similar.
Create an input with the same name as the output ("output"), and wire there the desired datatype. The output will then adapt to it.
05-25-2024 06:17 AM
Didn't get it... 😞
05-25-2024 11:44 AM
If you are going to learn LabVIEW, then learn LabVIEW -- there should be no "Matlab Script" in your code (it is much more complicated dealing with two programming paradigms that have different ways of representing data, arithmetic, etc.).
Here are a few questions and assumptions:
Point #1 is my assumption. #2 gets to the heart of the question, What are you trying to do? The method(s) to solve each of the two #2 tasks have approaches with similarities and differences!
Whatever the task, it is going to involve choosing particular elements of an array and using them to construct another array. Practice with pencil and paper and an initial array of [1, 2, 3] (you should be able to write down the six permutations, starting with the "identity" permutation [1, 2, 3] -- see if you can arrange them in a pattern (there will be several possible) and then deduce a "rule" for going from one pattern to another. Test it out with [1, 2, 3, 4], then code it in LabVIEW for [1, 2, 3, 4, 5, 6].
Bob Schor
P.S. -- this problem can be solved with a "recursive VI", one that calls itself, which LabVIEW allows, but is a semi-advanced topic. Ask your instructor about LabVIEW recursive VIs and revisit this problem at the end of the course.