Plotting Excel Data in Matlab: How to Combine Multiple Rows into One Figure

In summary, the student is asking for help with plotting 4 sets of data points in a single figure using MATLAB. They have tried using the scatter plot function, but found it to be too cluttered. They are looking for a way to plot the points inside a circle, and have been advised to use the plot3 function and adjust the LineStyle properties to only plot the data points without connecting them.
  • #1
ppmko
11
0

Homework Statement



I have 4 rows of data for a single entity in excel file

Homework Equations


i want to plot all the 4 rows in a single figure in matlab


The Attempt at a Solution


i know how to import the excel data but can find a figure or a function where i can plot these 4 rows in a single circle. scatter plot looks odd too clumsy. is there anything better
 
Physics news on Phys.org
  • #2
Sorry, I'm unclear of what you're asking here.

Are you attempting to plot a pie chart?

Or are you trying to plot several data sets on the same graph?
 
  • #3
I have 4 sets of data of points with x,y,z coordinates in an excel file
I want to plot all the data points in one plot
and I want all these points to be inside a circle.
 
  • #4
ppmko said:
I have 4 sets of data of points with x,y,z coordinates in an excel file
I want to plot all the data points in one plot
and I want all these points to be inside a circle.

Well, you can plot points in 3D in MATLAB using the plot3 function:
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/plot3.html

I don't understand what you mean by plotting the points inside a circle, however. Unless you mean that the points are coordinates of a circle in 3D space. Otherwise, they'll just be a bunch of random points in 3D space.
 
  • #5
Yes these are coordinates of points inside the circle. I know plot3 but that just creats circle. i want these coordinates inside the circle.
 
  • #6
Ah, I think I see. You want to only plot the data points, and not have MATLAB automatically join these points together? Well, you can do that just by changing some of the LineStyle properties:

http://www.mathworks.com/access/helpdesk/help/techdoc/creating_plots/f6-20079.html#f6-26386
 
Last edited by a moderator:

1. How do I import my Excel data into Matlab?

To import your Excel data into Matlab, you can use the "xlsread" function. This function allows you to specify the file name and sheet name of your Excel file, as well as the range of cells that you want to import.

2. Can I combine multiple rows of data into one figure in Matlab?

Yes, you can use the "hold on" command in Matlab to plot multiple rows of data on the same figure. This will allow you to see the relationship between the different rows of data.

3. How do I customize the appearance of my Excel data plot in Matlab?

You can use various plotting functions in Matlab, such as "plot", "scatter", and "bar", to customize the appearance of your Excel data plot. Additionally, you can use commands such as "xlabel", "ylabel", and "title" to add labels and titles to your plot.

4. Can I save my Excel data plot in Matlab as an image file?

Yes, you can save your Excel data plot as an image file in Matlab using the "saveas" function. This function allows you to specify the file name and file format, such as PNG or JPEG, for your saved plot.

5. How do I add a legend to my Excel data plot in Matlab?

You can use the "legend" command in Matlab to add a legend to your Excel data plot. This command allows you to specify the labels for each of your plotted data sets and their corresponding colors or markers.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
4
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
886
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
1K
Back
Top