MATLAB plot on an axe on a different figure

  • Context: MATLAB 
  • Thread starter Thread starter Gean
  • Start date Start date
  • Tags Tags
    Figure Matlab Plot
Click For Summary
SUMMARY

The discussion centers on plotting data in real-time from a main MATLAB script (main.m) to a secondary figure (test1.m) using handles. The user seeks to implement this functionality within a for-loop, acknowledging MATLAB's lack of multi-threading support. The solution involves obtaining a handle to the plot window rather than the individual plots. This approach allows for dynamic updates to the figure during data processing.

PREREQUISITES
  • Familiarity with MATLAB scripting and functions
  • Understanding of figure handles in MATLAB
  • Knowledge of for-loops in MATLAB
  • Basic concepts of real-time data visualization
NEXT STEPS
  • Explore MATLAB figure handles and how to manipulate them
  • Learn about real-time plotting techniques in MATLAB
  • Investigate the use of timers in MATLAB for periodic updates
  • Review examples of multi-figure plotting in MATLAB
USEFUL FOR

MATLAB users, data scientists, and engineers looking to implement real-time data visualization techniques in their applications.

Gean
Messages
5
Reaction score
0
Hi,

I have this problem:
I have a main file (main.m) in which is coded a for loop (needed for some data-gathering). De data is stored in a vector.
This vector is passes to a 2nd figure (test1.m) which has an axe. Here I want to plot the data in a "real-time" mode. I do this with another for-loop.
Because MATLAB apparently doens't support Multi-threading, I want to edit main.m on this way:
Inside the for-loop I want to say something like: plot in the axe in test1.m.

I understand that this must be done with handles, but I can't figure out how to do this.


Any help?
 
Physics news on Phys.org
Thanks!
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 32 ·
2
Replies
32
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
3
Views
2K
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K