student302

0 Reputation

2 Badges

12 years, 275 days

MaplePrimes Activity


These are questions asked by student302

I have the following procedure that I am working with. I would like to store the result of the procedure in a variable called "result".

[code]
f := proc(result, x)
     if x <= -7 then
         result :=  1:
     elif x > -7 and x <= 7 then
         result := 2:
     elif x > 7 then
 ...

I am presently using Tally to read through a list of numbers to try and calculate their frequency, I end up with a list as follows:

frequency := [1 = 6, 2 = 7, 3 = 91, 4 = 10], etc.

Now, I've been given a function that should turn this function into a "list of lists":

[code]
list_of_lists := n -> [ op(n)[1],  op(n)[2] ]
[/code]

As can be expected from looking at this function, it only returns the first two elements from the original list

So I am fairly new to maple and haven't really worked with it up until a couple of weeks ago. I am taking a physics course which requires us to do some work in maple and I am struggling to learn some of the concepts behind the data structures.

I have to essentially be able to parse a list of "Student Records" with names and marks received, and then store the data in a new list with the student name, and their average.

Essentially I am given:

[code]

Page 1 of 1