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 CenterFile Exchange에서 View 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