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

Highlighted

08-14-2020 09:50 PM

Options

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

Greetings,

Attached for your reference the prep guide I think most of you have using.

Under Labview programming fundamentals:

Q4: which VI will generate the output shown in the graph. The answer guide says answer D is correct. Answer D generates the graph shown but

the (simpler) code in answer B also generates that same graph. I'm not seeing why the more complex code in D is supposedly the correct/better answer

Q7: Numeric control is set to 2.5. Which case executes. For a value of 2.5 case 2 executes. For a value of 2.51 case 3 executes. It seems that 2.5 is rounded(?)

to 2. The convention is to round 2.5 to 3. Why does Labview deviate from the widely used convention 2.5 -> 3, 2.49 ->2.4 (or 2 if the answer needs to be an integer)

Highlighted
Options

08-14-2020 11:23 PM

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

Ok. I guess I found the answer to question Q7: apparently the arbitrary rule is to round xx.5 to the nearest __even__ number. In that case 2.5 rounds to 2. Rounding anything.5 __down__ is completely new to me and I have been on the science side of things for a long time. Just tried it in Python, print(round(2.5)) indeed outputs 2.

But round(2.5) in Matlab outputs the value 3. So it seems completely arbitrary but I guess what matters is what Labview does here......very confusing.

Highlighted
Options

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

08-15-2020 06:19 AM

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

@ArneB wrote:

Ok. I guess I found the answer to question Q7: apparently the arbitrary rule is to round xx.5 to the nearest

evennumber. In that case 2.5 rounds to 2. Rounding anything.5downis completely new to me and I have been on the science side of things for a long time. Just tried it in Python, print(round(2.5)) indeed outputs 2.But round(2.5) in Matlab outputs the value 3. So it seems completely arbitrary but I guess what matters is what Labview does here......very confusing.

It shouldn't be so arbitrary. The IEEE Standard (IEEE-754) states to use "Banker's Rounding" (round to nearest even integer) by default because it eliminates statistical biasing.

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

Highlighted
Options

08-15-2020 05:22 PM

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

Hi there,

Thanks for replying.

Rounding half to even by might be the default method but it is also stated that round half up, the only one I have ever used or seen, is widely used.

The fact alone that the IEEE standard defines five different rounding rules (and apparently there are more) with none of them being 'wrong' makes this

look pretty arbitrary to me. Rounding half to odd also eliminates biasing. But in any case, as I mentioned, considering the topic at hand all that matters is what

Labview does rounding wise. Although I can see a potential for a problem if Labview is used in conjunction with a language that rounds in a different way.

Highlighted
Options

08-17-2020 07:26 AM

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

crossrulz said it all, but here are some more details about the reason LabVIEW uses bankers rounding.

Different rounding may have its advantages in different situations, and maybe that is the reason different languages have different "default" rounding, but since bankers rounding is the best way to round data used for statistical analysis, I think LabVIEW has got it right.

I stumbled upon a discussion about it with some examples.

Highlighted
Options

08-22-2020 09:21 PM

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

Thanks everyone for the replies on the rounding part. I think I understand why Labview does it the way it does it now. Never meant to imply it was wrong. Just wasn't familiar with the various ways to round I guess.

That said, if anyone can give me some insight on that Q4 that would be great. Both pieces of code result in the same graph, why is the more complicated code the better choice?

Highlighted
Options

08-24-2020 01:05 AM

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

Highlighted
Options
Sorry, for the life of me I see no difference between the output of answer B vs D. And technically neither output exactly matches the output given.

08-29-2020 12:07 AM

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

Highlighted
Options

08-31-2020 01:08 AM

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

Sorry, my bad. I mixed up B and C, I read to fast (thought the answer was below the letter and not mostly above).

You are right that the output of B and D matches exactly. So now I don't know what to say. Maybe to trust that you know what is right now and can take the exam :). Or can there be multiple correct answers? Maybe, I don't remember.

Highlighted
Options

09-15-2020 05:41 PM

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

@ArneB wrote:

Look closer at the "Build Array" function in option B in the guide (not in the code you wrote).

The output of B is a 1D array, not a 2D array. This is because the "Build Array" function has "Concatenate Inputs" checked (right-click "Build Array" to look at/change it).

If the "Build Array" function didn't have "Concatenate Inputs" checked (like in the code you wrote), its output would be a 2D array, and it would be a *much* better answer than D (at least in my opinion). But as written, option B is just wrong.

I hope that helps!

-joeorbob

P.S. Here's a look at what you coded and what is in the question side-by-side: