Message Boards Message Boards

0
|
3635 Views
|
4 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Generate a sequence of Around's from two lists

Posted 3 years ago

Suppose I have the measured signal v

v = {5,6,7,8,9,10}

complemented with the uncertainty for each measurement:

err = {0.13, 0.09, 0.74, 0.98, 0.38, 0.53}

How do I generate the following list:?

{
 Around[5, 0.13],
 Around[6, 0.09],
 Around[7, 0.74],
 Around[8, 0.98],
 Around[9, 0.38],
 Around[10, 0.53]
 }

I think I need to use either Map or Apply, together with a pure function that has two slots, but I couldn't find a solution up to now, after 40 minutes of trial and error. I am still a novice using these functions.

Any help or suggestion would be helpful!

POSTED BY: Ehud Behar
4 Replies
Posted 3 years ago

Another way

Around @@@ Transpose[{v, err}]
POSTED BY: Rohit Namjoshi

Use MapThread[]

MapThread[Around[#1,#2]&,{v,err}]

Regards.

POSTED BY: Neil Singer
Posted 3 years ago

Perfect. Thanks!

POSTED BY: Ehud Behar

It is sufficient to do

MapThread[Around, {v, err}]
POSTED BY: Jon McLoone
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract