Displaying the name of the moving text file in the animation

3 vues (au cours des 30 derniers jours)
Eng.
Eng. le 1 Juin 2023
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

Réponses (1)

chicken vector
chicken vector le 1 Juin 2023
Modifié(e) : chicken vector le 1 Juin 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);

Catégories

En savoir plus sur View and Analyze Simulation Results dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by