how to put title in graph

8 visualizaciones (últimos 30 días)
jaekeun lim
jaekeun lim el 6 de Sept. de 2019
Comentada: jaekeun lim el 7 de Sept. de 2019
I would like to put title in each graph with original file names. However, when I try it, error message was given "You cannot subscript a table using linear indexing (one subscript) or multidimensional indexing (three or more subscripts). Use a row subscript and a variable subscript."
I could not find the solution. Could you help me?
I put core code for this question.
filelists = dir('*.txt');
file = length(filelists);
title = struct2table(filelists);
title_2 = title{:,1};
title_S = erase(title_2,".txt");
for i= 1:file
title_ind{i} = title_S{i};
h=figure;
plot(f2{i},xf{i},yf{i})
hold on
title(title_ind{i})
hold off
end

Respuesta aceptada

Walter Roberson
Walter Roberson el 7 de Sept. de 2019
You assigned
title = struct2table(filelists);
That creates a variable name title, which makes it difficult to use the function named title()
Do not use title as the name of a variable.

Más respuestas (0)

Categorías

Más información sobre Title en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by