Create plot (fig file) from text file
Mostrar comentarios más antiguos
I am using the below code to import data from text file. The code is working, but the .Fig file are very slow afterwards
Is the code ok, or is there a better way
datafile = 'Test_1_pre_test_with_Prose_Fan_Load_streng_1_error_at_8_procent_115222_230119_TEST_1.txt';
T = readtable(datafile,'Format','auto');
T1 =T;
hold on
t = T1.TIME;
P = T1.Properties.VariableNames(2:end);
for K = 1 : length(P)
fn = P{K};
plot(t, T1.(fn), 'DisplayName', fn);
end
hold off
set(gcf, 'visible', 'on')
legend show
Respuestas (1)
Walter Roberson
el 19 de En. de 2023
T = readtable(datafile,'Format','auto');
P = string(T.Properties.VariableNames) ;
plot(T, P(1), P(2:end)) ;
legend show
7 comentarios
Steen
el 23 de En. de 2023
Walter Roberson
el 23 de En. de 2023
Yes. string() is being applied to a cell array of character vectors that hold the field names. string() is not being applied to the numeric content.
Steen
el 23 de En. de 2023
Walter Roberson
el 23 de En. de 2023
Try a shorter file name.
Generally speaking it is often more robust to save files to the local system and copy the resulting file to the network file system,instead of saving directly to the network
Steen
el 24 de En. de 2023
Walter Roberson
el 24 de En. de 2023
Steen
el 31 de En. de 2023
Categorías
Más información sobre Annotations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
