How to plot different tdms file data on same figure within a loop?

5 views (last 30 days)
Hello, thanks for taking a look:
I want to plot certain data from LabView tdms files after I convert them to .mat file(s). I have a script to allow the user to select which files to convert. Once the files are selected, a function is called to convert the files, one at a time, to .mat file. Then proceed to plot the power consumption (from tdms file). The script plots the data correctly, but I can either:
-plot on separate figures, or, -have the first figure overwritten by second figure.
Thanks, John

Accepted Answer

Jan
Jan on 10 Jan 2013
Edited: Jan on 10 Jan 2013
And what do you want to achieve exactly? A Subplot for each file or collecting the data of all files in one diagram using different line colors? Or do the files contain data recorded to different time, such that the new data are appended to the line(s) of the existing diagram?
Please explane the term "same figure" with more details. When you post the relevant code, suggesting a modification is much easier for us and for yourself.
  4 Comments
John
John on 11 Jan 2013
Hey Jan, thanks for the response.
I implemented the above, and as-is, it doesn't recognize "AxesH" after the else. So I added the "AxesH=axes" and it keeps the axis setting for the first plot, but still overwrites the first set of data and calls itself figure(1). I'll work on it more now. So frustrating because it is such a simple request!
Thanks, John
John
John on 11 Jan 2013
I figured it out! Thanks for your help. With the addition of the "hold on" after the else, it kept both files on the same figure!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!