Create plot (fig file) from text file
2 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
回答 (1 件)
Walter Roberson
2023 年 1 月 19 日
T = readtable(datafile,'Format','auto');
P = string(T.Properties.VariableNames) ;
plot(T, P(1), P(2:end)) ;
legend show
参考
カテゴリ
Help Center および File Exchange で Measurements and Statistics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!