Matlab - plotting huge amounts of data

Click For Summary

Discussion Overview

The discussion revolves around methods for plotting a set of 100 data points in Matlab, specifically exploring alternatives to manually entering data into arrays for plotting.

Discussion Character

  • Exploratory
  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant questions the need for creating separate arrays for each column when plotting 100 data points in Matlab.
  • Another participant clarifies that they are referring to creating x and y column vectors for plotting, and expresses concern about the effort involved in typing all data points directly into Matlab.
  • A suggestion is made to use a vector creation method in Matlab, such as using the colon operator or the "linspace" function, to generate data points more efficiently.
  • A participant inquires about the current location of the data points, implying that knowing this could lead to alternative methods for plotting.
  • Importing data from Excel into Matlab is proposed as a potential solution for handling the data points without manual entry.

Areas of Agreement / Disagreement

Participants have not reached a consensus on the best method for plotting the data points, and multiple approaches are being discussed without resolution.

Contextual Notes

Participants have not specified the format or source of the data points, which may affect the suggested methods for plotting.

Who May Find This Useful

Users looking for efficient ways to plot data in Matlab, particularly those dealing with multiple data points or seeking alternatives to manual data entry.

eurekameh
Messages
209
Reaction score
0
I have a table of 100 data points. I want to plot this on Matlab. Is there any other way for me to do this other than making an array for each column and then plotting it?
 
Physics news on Phys.org
First off, 100 points is not huge. Not sure what you mean by "making an array for each column". What have you tried? Show what you tried.
 
Sorry for the confusion. I meant making an x and y column vector and then just plotting them with each other. I know 100 points is not huge, but when typing in these 100 data points directly into Matlab, it is a lot.

For example,
x = [x1 x2 x3 ...]';
y = [y1 y2 y3 ...]';
plot(x,y);

where x1, x2, y1, y2 are the discrete data points, and if I have something like a hundred of these, it can seem like a lot. What I'm trying to ask is if there is another way that I can plot x vs. y without having to directly type all of these data points into Matlab.
 
Not sure if I am right, but I might give it a try. I am new to MATLAB.

what if you try something like :

v = start : spacing : end

where v is the vector containing the starting value, increment value (optional) and finally the end value.

example : v = 1:10 % this will create a vector from 1 to 10

v = 1:2:10 % this will give 1 3 5 7 9

You might also type "help linspace" in your MATLAB command window, maybe that command is useful to you.

Good luck.
 
eurekameh said:
where x1, x2, y1, y2 are the discrete data points, and if I have something like a hundred of these, it can seem like a lot. What I'm trying to ask is if there is another way that I can plot x vs. y without having to directly type all of these data points into Matlab.

Where do these data points reside right now?
 
If you have those datapoints in Excel you could just import them into MATLAB
 

Similar threads

Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K