LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Integer Factors

Of course you should always have one of these on the thumb drive on your keychain. Smiley Wink

!0.png


"Should be" isn't "Is" -Jay
Message 11 of 18
(3,415 Views)

fxgbhsfh wrote:

Create a vi that determines all the factors of an integer that is input by the user. The results should  be displayed in an array. display only the factors on the front panel (no zeros) . 


Are you looking for all possible integer factors or for all prime factors (a more typical problem).

0 Kudos
Message 12 of 18
(3,406 Views)

Not sure what this is 

0 Kudos
Message 13 of 18
(3,364 Views)

That is an empty array constant.  Put an array constant down on your block diagram.  Do the same for a numeric constant.  Now drag the numeric constant into the array constant.  You will need to set the numeric representation to I32 to make all of the data types correct.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 14 of 18
(3,359 Views)

@crossrulz wrote:

That is an empty array constant.  Put an array constant down on your block diagram.  Do the same for a numeric constant.  Now drag the numeric constant into the array constant.  You will need to set the numeric representation to I32 to make all of the data types correct.


Of you could just wire up everything else first, then right-click the left shift register and select "create constant". One step! 😄

0 Kudos
Message 15 of 18
(3,331 Views)

!0.png

 

 

 

 

 

What is the 1, for the first case, and the false for the second case.

0 Kudos
Message 16 of 18
(3,270 Views)

Hi HylerTeck,

 

Here are the screenshots of the two cases. 

 

The example is a VI Snippet. VI Snippets, as a png file, can be saved to your computer and then dragged to an empty VI. A VI Snippet is a special png file that contains the LabVIEW code.

 

True Case:

TrueCase.JPG

"1" Case

1Case.JPG

 

Regards,

Jordan G.

LabVIEW Product Marketing Engineer
National Instruments
0 Kudos
Message 17 of 18
(3,233 Views)

HylerTeck wrote:

 

 

 

What is the 1, for the first case, and the false for the second case.


1, Default  So the remainder of Number and "i"+2 is something other than zero. (So multiplying "I+2 by any number will not = number- it is not an integer factor - toss it out!)

2.   i+2 = Q  we don't need to duplicate the square factor.  e.g if Number is 25 and i is 3 Quotient and i+2 are both 5

 

(Wow that was a long time between bumps)


"Should be" isn't "Is" -Jay
0 Kudos
Message 18 of 18
(3,223 Views)