Connecting the point selectively

  • Thread starter hokhani
  • Start date
  • Tags
    Point
In summary, when running the Matlab code, two discrete regions appear, one in the left and the other in the right. To keep the two regions separated, you can connect the points of each region together by breaking the X and Y coordinates in half and plotting them separately with the '-*' option to ensure the points are connected with a line.
  • #1
hokhani
483
8
Running the Matlab code below two discrete regions appear; one in left and the other in right.
Code:
x=20:5:800;
xpr=x*pi/180;
y=sin(xpr);
n=find(y<.2);
plot(x(n),y(n),'*')
I would like to connect the points of each region together and not to connect the rightmost point of the left region to the leftmost point of the right region so that the two regions remain separated. What should I do? I appreciate any help.
 
Physics news on Phys.org
  • #2
Code:
x=20:5:800;
xpr=x*pi/180;
y=sin(xpr);
n=find(y<.2);

X = xpr(n);
Y = y(n);
N = length(X)/2;
plot(X(1:N), Y(1:N), '-*', X(N+1:end), Y(N+1:end), '-*')

Since you scaled x to xpr, I plotted xpr since it is used to calculate y. But essentially all I did was break X and Y in half, then plot the first and second halves separately in the call to plot. The '-*' ensures that plot draws the point and connects with a line. The result is below. Note that since the plots are separate, they get different colors. You can get around that by specifying the same color for both, for example by saying '-*b' to make both plots blue.

sin_plots.png
 
  • Like
Likes hokhani

What is the purpose of connecting the point selectively?

The purpose of connecting the point selectively is to establish a specific connection between two points in a system or network, rather than connecting all points together. This can help optimize the efficiency and effectiveness of the system, as well as reduce the risk of errors or malfunctions.

How does selective point connection work?

Selective point connection involves choosing specific points within a system or network and establishing connections between them using various methods such as routing protocols, circuit switching, or packet switching. This allows for targeted communication and data transfer between the selected points.

What are the benefits of using selective point connection?

Selective point connection offers several benefits, including improved efficiency and speed of data transfer, reduced risk of errors or malfunctions, increased security by limiting access to only selected points, and better control over network traffic and communication.

What are some common applications of selective point connection?

Selective point connection is commonly used in various industries and fields, such as telecommunications, computer networking, transportation systems, and power grids. It is also used in everyday technologies, such as smartphones, laptops, and smart home devices.

What are some potential challenges of implementing selective point connection?

One potential challenge of implementing selective point connection is the complexity of setting up and maintaining the connections. Additionally, selecting the wrong points or not properly configuring the connections can lead to communication issues or system failures. It may also require a significant amount of resources and expertise to implement in large-scale systems.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
560
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
14
Views
2K
  • Calculus and Beyond Homework Help
Replies
3
Views
260
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
Back
Top