Last change
on this file since 4 was
4,
checked in by zhangj, 11 years ago
|
Initial import--MML version from SOLEIL@2013
|
File size:
1.4 KB
|
Line | |
---|
1 | function plotcyclingcurve(curve) |
---|
2 | % |
---|
3 | % INPUTS |
---|
4 | % 1. curve - n x 2 array amplitude versus time loaded in Cycling Dserver |
---|
5 | % or a cell array see getcyclecurve for details |
---|
6 | % |
---|
7 | % EXAMPLES |
---|
8 | % 1. plotcyclingcurve(getcyclecurve('LT1/AE/cycleQ.1')) |
---|
9 | % 2. plotcyclingcurve(getcyclecurve('CycleQP')) |
---|
10 | % 3. plotcyclingcurve(getcyclecurve('CycleQ12')) |
---|
11 | % |
---|
12 | % See also setcyclecurve, getcyclecurve |
---|
13 | |
---|
14 | % |
---|
15 | % Written by Laurent S. Nadolski |
---|
16 | |
---|
17 | |
---|
18 | if iscell(curve) |
---|
19 | for k=1:length(curve), |
---|
20 | n = size(curve{k}.Data,1); |
---|
21 | % time vector |
---|
22 | cums = cumsum(curve{k}.Data(:,2))'; |
---|
23 | x = [cums; cums]; |
---|
24 | x = reshape(x,1,2*n); |
---|
25 | x = [0 x(1:end-1)]; |
---|
26 | |
---|
27 | % amplitude vector |
---|
28 | y = [curve{k}.Data(:,1),curve{k}.Data(:,1)]'; |
---|
29 | y = reshape(y,1,2*n); |
---|
30 | |
---|
31 | figure; |
---|
32 | plot(x,y,'b.-'); |
---|
33 | xlabel('Temps (s)'); |
---|
34 | ylabel('Courant [A]'); |
---|
35 | ylim([min(y) max(y)*1.05]); |
---|
36 | title(['Cycling curve for ' curve{k}.DeviceName]); |
---|
37 | grid on |
---|
38 | end |
---|
39 | else |
---|
40 | n = size(curve,1); |
---|
41 | % time vector |
---|
42 | cums = cumsum(curve(:,2))'; |
---|
43 | x = [cums; cums]; |
---|
44 | x = reshape(x,1,2*n); |
---|
45 | x = [0 x(1:end-1)]; |
---|
46 | |
---|
47 | % amplitude vector |
---|
48 | y = [curve(:,1),curve(:,1)]'; |
---|
49 | y = reshape(y,1,2*n); |
---|
50 | |
---|
51 | figure; |
---|
52 | plot(x,y,'b.-'); |
---|
53 | xlabel('Temps (s)'); |
---|
54 | ylabel('Courant [A]'); |
---|
55 | ylim([min(y) max(y)*1.05]); |
---|
56 | title('Courbe de cyclage'); |
---|
57 | |
---|
58 | grid on |
---|
59 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.