<分区>
我有很多文件名以以下形式标记:
test1_cvariable1_cvariable2_rvariable.csv
要自动加载和处理它们,我正在使用代码:
%filename
txt = ['test1_cvariable1_cvariable2_rvariable.csv']
%step 1
RNG = [23 0 1539 8];
M = csvread(txt,23,0,RNG);
然后我想绘制一个具有相应标题的图表,但是由于 matlab 如何解释下划线“_”,如果我使用:
%plot time vs variable
plot(M(:,1),M(:,8))
xlabel('Time (s)')
ylabel('Var')
title(['Var ' txt])
在表单中给出标题
test1cvariable1cvariable2rvariable
以 c、c 和 r 作为下标(很抱歉我不知道如何在这里做到这一点,具有讽刺意味)
如何让 Matlab 不将下划线后面的字符作为下标?