03-13-2021 01:07 PM
I have an assignment where I generate three random graded in a for loop then outside the loop average them. I am trying to have this average entered into a case statement to determine the letter grade however I keep getting an index array error. I want to only have dbls output from the for loop (wired into a bundle) for collection. What am I doing wrong? Or what function am I missing? Simply converting an array to a dbl would be enough of an answer for me.
Solved! Go to Solution.
03-13-2021 01:18 PM
@gleatd01 wrote:
What am I doing wrong? Or what function am I missing? Simply converting an array to a dbl would be enough of an answer for me.
We don't know. You didn't post a VI for us to see what you actually did.
03-13-2021 05:10 PM
Here you go, please help. It would be greatly appreciated.
03-13-2021 07:15 PM
You are NOT using a case structure, that's a stacked sequence. (Not sure where you found that, because it is not in the palette). You don't need the formula node for this.
(You are seem a bit confused with scalars and arrays. Have you done some simple LabVIEW tutorials yet?)
03-13-2021 10:05 PM
I have been working through Learning with LabView for an Online course we are on chapter 6 now. May have missed something.
03-14-2021 03:35 AM - edited 03-14-2021 04:04 AM
I see the following problems:
I think you might have simplified the problem description and left out too many details. Can you show us the full text of the assignment? In any case, this is a basic beginner problem and the solution should be significantly simpler that what you were doing.
03-14-2021 10:12 AM - last edited on 03-15-2021 11:21 AM by markwni
D6.2 is the problem I am working on.
03-14-2021 11:28 AM - edited 03-14-2021 11:38 AM
(In the meantime, also try to learn how to rotate and crop photographs. We are NOT dealing with 12MB of information here.)
As I suspected, you need to create a letter grade for each of the 20 (or whatever) students, so your control with 20 averages and only one letter grade is insufficient. The book says to to create an array of clusters, where each cluster element contains the information for one student.
Note that the book seem to have logical problems too, for example it does not define what should happen if the course average is 79.5%.
Done right, the case structure can replace your formula node. In fact there are simple methods to detect ranges using threshold array and an array of limits, then indexing into an array of letters. No case structure or formula node needed.
03-14-2021 01:03 PM - edited 03-14-2021 01:04 PM
Thank you altenbach, do you happen to know of a decent tutorial on threshold arrays? Also, it doesn't seem like much information about LabVIEW really exist outside of this site, are any well known tutorial sources around? I may just be failing to provide good keywords in my searches.
Thanks
03-14-2021 01:24 PM
Also, your saying I need to go more along this route? Time delay is only temporary, wanted to make sure its actually stepping through.