In Matlab, after plotting a figure then I select a range of area and replot again
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Teng Cheng Kang
am 23 Okt. 2020
Kommentiert: Teng Cheng Kang
am 27 Okt. 2020
Here is my program and figure, and I want to select a range of area and replot again finally calculate RMS
num1 = xlsread('2.1mm.csv','A2:A999999');
num2 = xlsread('2.1mm.csv','2.1mm','A3');
num3=(num1-num2)*86400;
num4 = xlsread('2.1mm.csv','c2:c999999');
plot(num3,num4);
set(gca, 'Fontname', 'Times New Roman','FontSize',24);
xlabel('time(sec)');
ylabel('g');
set(get(gca,'ylabel'),'rotation',0)
title('Spindle');
Sorry for the first consultation
0 Kommentare
Akzeptierte Antwort
KSSV
am 23 Okt. 2020
Yes you can very much do it....
If you have limits/ range for x-axis; you can limit your range in the existing plot using xlim, ylim, axis.
If you want to plot again and you want to restrict the range with data itself. Let val0 and val1 be your x-axis ranges.
idx = num3 >= val0 && num3 <= val1 ; % get indices
num3 = num3(idx) ;
num4 = num4(idx) ;
plot(num3,num4)
5 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Annotations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!