Using Matlab to discreetly distribute points

In summary, the conversation discusses discretely distributing points on a specific equation using Matlab and requests efficient code to do so. A link is provided for guidance on plotting with the option to use multiple markers for both branches of the equation.
  • #1
mcooper
29
0
I want to discreetly distribute N points on x2 + y2 = 2 using Matlab. What is the most efficient code to do this?

I am a relative novice to Matlab so don't have the vast library of code as yet.

Any help at all would be great.

Thanks!
 
Last edited:
Physics news on Phys.org
  • #2
You can do this pretty easily in MATLAB:
http://www.mathworks.com/access/helpdesk/help/techdoc/learn_matlab/f3-27853.html

If you did something along the lines of the following:
x=0:0.1:2*pi;
y=sin(x);
plot(x,y,'ko')

You'll have discrete black circles instead of a continuous sine graph (the above link shows you more about the basic plotting function in MATLAB along with the various parameters you can use).

EDIT: Remember that a circle isn't a proper function; there are two y values for every x value. What you can do is plot both branches (two sets of x's and y's) with the same marker--see the documentation again for how to do this.
 
Last edited by a moderator:
  • #3


Thank you for your question! I would suggest using the "scatter" function in Matlab to discreetly distribute N points on the equation x2 + y2 = 2. This function allows you to specify the number of points, their x and y coordinates, and any additional parameters such as color and size. Another option could be to use the "linspace" function to generate evenly spaced values for x and then solve for y using the given equation. This approach may be more efficient if you have a large number of points to distribute. Additionally, there are many helpful resources and tutorials available online for using Matlab, so I would recommend exploring those as well to build your library of code. I hope this helps and good luck with your project!
 

1. What is Matlab and how is it used for discreetly distributing points?

Matlab is a programming language and software environment commonly used for scientific computing and data analysis. It has built-in functions and tools that allow for efficient and discreet distribution of points in various applications, such as data visualization and signal processing.

2. What is the difference between discretizing and distributing points in Matlab?

In Matlab, discretizing refers to the process of dividing a continuous domain into smaller, discrete intervals. On the other hand, distributing points involves assigning specific values or coordinates to each interval or data point within a discrete domain.

3. Can Matlab handle large datasets for discreetly distributing points?

Yes, Matlab has the capability to handle large datasets and efficiently distribute points based on user-defined parameters. It also has parallel computing capabilities, allowing for faster processing of large datasets.

4. Are there any limitations to discreetly distributing points in Matlab?

While Matlab is a powerful tool for discreetly distributing points, it does have limitations depending on the specific application and dataset. Some limitations include memory constraints and processing speed, which may affect the accuracy and efficiency of the distribution.

5. Are there any resources available for learning how to use Matlab for discreetly distributing points?

Yes, there are many online tutorials, guides, and forums available for learning how to use Matlab for discreetly distributing points. The official Matlab website also offers documentation and examples for various functions and applications.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
809
  • Engineering and Comp Sci Homework Help
Replies
1
Views
940
  • Engineering and Comp Sci Homework Help
Replies
1
Views
881
  • Engineering and Comp Sci Homework Help
Replies
10
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
13
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
944
  • Engineering and Comp Sci Homework Help
Replies
7
Views
886
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
Back
Top