Displaying the name of the moving text file in the animation

3 views (last 30 days)
Hello;
I created an animation using 10 different txt files; however, I want to see the name of the txt file that has the image in the txt file on the screen at that moment. How can I do that. Thank you in advance

Answers (1)

chicken vector
chicken vector on 1 Jun 2023
Edited: chicken vector on 1 Jun 2023
Suppose you import the conent of the .txt files by doing:
filename = 'FrameXX.txt';
framData = readmatrix(filename);
Then the three most common ways of displaying a text are:
frameName = extractBefore(filename, '.txt');
figure;
title(frameName);
annotation('TextBox', [.45 .65 .1 .1], 'String', frameName, 'FitBoxToText', 'On');
text(.45, .9, frameName);

Categories

Find more on View and Analyze Simulation Results 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!