Sum Y Values for Repeating X Values to Plot 0-Crossing Point

In summary, The speaker is seeking help with an issue involving a large array of numbers representing coordinates of 9 curves on the same x-axis. They need to sum the Y values for each X value separately and plot it in a bar graph to determine where the sum of Y values crosses the 0 axis. They are advised to use the accumarray function to accomplish this task.
  • #1
DariusZizys
1
0
Hello guys,

Have an issue here.
I have a large array of numbers, X and Y values.These are coordinates of 9 curves on the same x-axis , so the X values are repeating (433 X values repeating 9 times), what I need to do is to sum Y values for each X value separately. and then plot it (bar plot would be great), I need to see at which place the sum ofY values cross he 0 axis ( the Y values are both possitive an negative).

Thanks in advance!
 
Physics news on Phys.org
  • #2

1. What is the purpose of summing Y values for repeating X values?

The purpose of summing Y values for repeating X values is to calculate the total value of Y at each X value. This is useful for plotting a graph and identifying the 0-crossing point, where the Y values cross the X-axis.

2. How is the sum of Y values for repeating X values calculated?

The sum of Y values for repeating X values is calculated by adding all the Y values that correspond to the same X value. For example, if there are three Y values for an X value of 3, the sum would be calculated by adding those three Y values together.

3. Why is it important to identify the 0-crossing point?

Identifying the 0-crossing point is important because it is the point where the Y values cross the X-axis and can give insight into the behavior of the data. This point can also be used to determine the intersection of two plots or to calculate the slope of a graph.

4. Can the sum of Y values for repeating X values be negative?

Yes, the sum of Y values for repeating X values can be negative. This can occur when the Y values are negative and the sum of those values is also negative. It is important to consider the sign of the sum when interpreting the data.

5. Are there any limitations to using the sum of Y values for repeating X values to plot the 0-crossing point?

Yes, there are some limitations to using the sum of Y values for repeating X values to plot the 0-crossing point. This method may not work well for non-linear data or if there are large variations in the Y values for a given X value. Additionally, it is important to ensure that the data is properly formatted and that there are no missing values in order to get an accurate result.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
896
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
11
Views
817
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
2K
Back
Top