一、文件讀取
文件保存成csv,或者txt,逗號分割;
res = readtable('/User/xxx/path/file.csv')
size = height(res)
二、繪製曲線
figure(1)
plot(res.x1(start_index:end_time),res.y1(start_index:end_time),'r-*','MarkerSize',5)
hold on
plot(res.x2(start_index:end_time),res.y2(start_index:end_time),'b--*','MarkerSize',3)
legend("Curve1","Curve2")
set(gca,'FontSize',14);
hold off
曲線顏色:r,b,k,c,g,y,,,
曲線形式:默認實線,--虛線,*,p,o標記
曲線粗細:‘MarkerSize’
字體設置:set(gca,'FontSize',14);
其他:
獲取matlab的table文件中某個元素的索引方法:
start_index = find(res.x1(:)==point);