List indexing

Hi Chris,

How do I extract parts of a list? I realise that I can index single values from a list variable and use a while loop for operations, however, this seems computationally expensive. Is there a quick way to flexibly extract several entries from a list (similar to Matlab/Python syntax)?

var[0:n]
var[n:m]
var[n:end]

Also, is there a built-in feature to sum or average lists?

Cheers
Felix

Hi Felix,

How do I extract parts of a list? I realise that I can index single values from a list variable and use a while loop for operations, however, this seems computationally expensive. Is there a quick way to flexibly extract several entries from a list (similar to Matlab/Python syntax)?

Unfortunately, no – MWorks doesn’t support this. As a workaround, you could perform complex list manipulation in Python (via run_python_file, run_python_string, or the py_eval function).

Also, is there a built-in feature to sum or average lists?

No, but you could use Python for this, too.

Cheers,
Chris