Displaying the name of the moving text file in the animation

3 ビュー (過去 30 日間)
Eng.
Eng. 2023 年 6 月 1 日
編集済み: chicken vector 2023 年 6 月 1 日
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

回答 (1 件)

chicken vector
chicken vector 2023 年 6 月 1 日
編集済み: chicken vector 2023 年 6 月 1 日
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);

カテゴリ

Help Center および File ExchangeView and Analyze Simulation Results についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by