Progressive graph/plots

8 views (last 30 days)
Sachin Shridhar Paradkar
Sachin Shridhar Paradkar on 14 Mar 2019
Edited: Agnish Dutta on 18 Mar 2019
I have 7000 iteration/plots which have been taken every second from the 1st second to the 7000th second and all of this has to be plotted into one graph progressively. The figure below is the plot/graph of the first second. Is there a function to do this?
Is there a possibility to have all the data linked to a single graph and then have a slider of some sorts on the graph to see all the various iterations depending on what one would like to see?
data_plot.PNG
  1 Comment
Agnish Dutta
Agnish Dutta on 18 Mar 2019
Edited: Agnish Dutta on 18 Mar 2019
If you want a slider that changes the plot, then what could be done is to use MATLAB appdesigner and include all necessary elements such as an 'Axes' object to display the selected plot and a 'Slider' object with a callback that changes the selected plot. A callback is basically a function that is executed when a specific Event such as moving a slider is triggered. Objects such as buttons, sliders and checkboxes can trigger events.
Next you'll need a way to import data for the needed plots. For that you can use a 'Text Field' along with a browse 'Button'. Add a call back to the Button click event containing the function 'uigetfile'. This will allow you to get the file as well as the path at which your data is stored.
[file,path] = uigetfile % returns the file name and path to the file when the user clicks Open. If the user clicks Cancel or the window close button (X), then uigetfile returns 0 for both of the output arguments.
The callback function on the slider can now use the data from the file returned by uigetfile function to plot the required graph on the Axes object. For example, given x and y you can generate a plot with the following code:
x = linspace(-pi,pi,50);
y = 5*sin(x);
plot(ax,x,y)
Relevant links:
App Designer) Create UI axes for plots in App Designer:https://www.mathworks.com/help/matlab/ref/uiaxes.html.

Sign in to comment.

Answers (0)

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!