Skip to main content
added 2 characters in body
Source Link

I often have the following notebook in Mathematica, which I use to make a dataset and associated errors:

x = {0, 2, 4, 6, 10, 20};
y = {979, 146, 141, 157, 187, 274};
uncY = Sqrt[y];
dataVector = Thread[{x, y}];

I want to make an ErrorListPlotErrorListPlot, so I need to add ErrorBar with each uncY-value as an element in each data pair. So the final dataVectordataVector should have the form

{{x_i, y_i}, Errorbar[uncY_i]}

What is an easy way to achieve this, without using a For-loop?

I often have the following notebook in Mathematica, which I use to make a dataset and associated errors:

x = {0, 2, 4, 6, 10, 20};
y = {979, 146, 141, 157, 187, 274};
uncY = Sqrt[y];
dataVector = Thread[{x, y}];

I want to make an ErrorListPlot, so I need to add ErrorBar with each uncY-value as an element in each data pair. So the final dataVector should have the form

{{x_i, y_i}, Errorbar[uncY_i]}

What is an easy way to achieve this, without using a For-loop?

I often have the following notebook in Mathematica, which I use to make a dataset and associated errors:

x = {0, 2, 4, 6, 10, 20};
y = {979, 146, 141, 157, 187, 274};
uncY = Sqrt[y];
dataVector = Thread[{x, y}];

I want to make an ErrorListPlot, so I need to add ErrorBar with each uncY-value as an element in each data pair. So the final dataVector should have the form

{{x_i, y_i}, Errorbar[uncY_i]}

What is an easy way to achieve this, without using a For-loop?

General cleanup
Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259

adding elements to vectors without explicit Preparing data for-loop making an ErrorListPlot

I often have the following notebook in MathematicaMathematica, which I use to make a dataset and associated errors:

x = {0, 2, 4, 6, 10, 20};
 
y = {979, 146, 141, 157, 187, 274};
uncY = Sqrt[y];
dataVector = Thread[{x, y}];

I want to make an errorlistplotErrorListPlot, so I need to add ErrorBar with each uncY-value as an element in each data pair. So the final dataVector should have the form

{{x_i, y_i}, Errorbar[uncY_i]}

What is an easy way to achieve this, without using a For-loop?

adding elements to vectors without explicit for-loop

I often have the following notebook in Mathematica, which I use to make a dataset and associated errors:

x = {0, 2, 4, 6, 10, 20};
 
y = {979, 146, 141, 157, 187, 274};
uncY = Sqrt[y];
dataVector = Thread[{x, y}];

I want to make an errorlistplot, so I need to add ErrorBar with each uncY-value as an element in each data pair. So the final dataVector should have the form

{{x_i, y_i}, Errorbar[uncY_i]}

What is an easy way to achieve this, without using a For-loop?

Preparing data for making an ErrorListPlot

I often have the following notebook in Mathematica, which I use to make a dataset and associated errors:

x = {0, 2, 4, 6, 10, 20};
y = {979, 146, 141, 157, 187, 274};
uncY = Sqrt[y];
dataVector = Thread[{x, y}];

I want to make an ErrorListPlot, so I need to add ErrorBar with each uncY-value as an element in each data pair. So the final dataVector should have the form

{{x_i, y_i}, Errorbar[uncY_i]}

What is an easy way to achieve this, without using a For-loop?

Source Link
BillyJean
  • 1.3k
  • 8
  • 25

adding elements to vectors without explicit for-loop

I often have the following notebook in Mathematica, which I use to make a dataset and associated errors:

x = {0, 2, 4, 6, 10, 20};

y = {979, 146, 141, 157, 187, 274};
uncY = Sqrt[y];
dataVector = Thread[{x, y}];

I want to make an errorlistplot, so I need to add ErrorBar with each uncY-value as an element in each data pair. So the final dataVector should have the form

{{x_i, y_i}, Errorbar[uncY_i]}

What is an easy way to achieve this, without using a For-loop?