Matlab help please (generating a plot from this data)

In summary, the conversation discusses generating a plot from saved data in PDF format. The data is iterations of optimizing a function and cannot be copied and pasted into the live window. Possible solutions include pasting the data into a text file or Excel and saving as CSV or text, then loading it into the live window. Additionally, it is suggested to paste the code under the originally generated data to generate the plots. The question of whether the text file can be pasted directly into the live window or if it needs to be called upon is also raised.
  • #1
binbagsss
1,254
11
Hi

I have saved data in pdf format, and I wish to generate a plot from this data.

The data is iterations of optimising some function.

I can't just copy and paste it into the live window obviously and then try to generate a figure, so how can I generate a figure, just as I would have done had this data been freshly generated in the live window by using the relevant commands directly underneath it.

Many thanks
 
Physics news on Phys.org
  • #2
Paste the data into a text file, or into Excel then save as CSV or text, then load from the text file?
 
  • #3
Ibix said:
Paste the data into a text file, or into Excel then save as CSV or text, then load from the text file?
and then if i past the code i previusly was, under the originally gerneated data, it will genreate the plots?
Could I paste this from the text file in the live window, or would i need to call upon this file?
 

1. How do I generate a plot from my data in Matlab?

To generate a plot from your data in Matlab, you can use the plot function. This function takes in your data as the input and creates a plot with the data points connected by lines.

2. Can I customize the appearance of my plot in Matlab?

Yes, you can customize the appearance of your plot in Matlab by using various options and commands. For example, you can change the color, style, and thickness of the lines as well as add labels and titles to your plot.

3. How do I add multiple data sets to one plot in Matlab?

You can add multiple data sets to one plot in Matlab by using the hold on command. This command allows you to plot multiple sets of data on the same plot without erasing the previous data.

4. Is there a way to save my plot as an image in Matlab?

Yes, you can save your plot as an image in Matlab by using the saveas function. This function allows you to save your plot in various formats such as JPEG, PNG, and PDF.

5. Can I add a legend to my plot in Matlab?

Yes, you can add a legend to your plot in Matlab by using the legend function. This function allows you to label your different data sets and provide a key for understanding the plot.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
964
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
3K
  • Programming and Computer Science
Replies
1
Views
283
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
6K
Back
Top