-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_data.m
More file actions
32 lines (26 loc) · 957 Bytes
/
plot_data.m
File metadata and controls
32 lines (26 loc) · 957 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
%% plot_data.m
% Simple function to plot data from D-TACQ system.
function plot_data(ch_mask,vsf,num_samp)
% "hold all" OR one plot command
close all; hold all
CHx = evalin('base','CHx');
for i=ch_mask
CHx{i} = CHx{i}.*vsf(i); % Scale to volts
end
index = 1:num_samp;
%index = index./samp_rate; %Uncomment this line for seconds on x-axis
fig1 = figure(1);
for i=ch_mask
plot(index, CHx{i}) % Plot channel
label_array{i} = sprintf('CH%02d',i); % Record labels for figure legend
end
label_array = label_array(~cellfun('isempty',label_array)); % Remove empty elements from cell array
%title('Transient Capture')
xlabel('Samples');
%xlabel('Seconds');
ylabel('Volts');
legend(label_array);
hold off
set(fig1,'units','normalized','outerposition',[0 0 1 1]); % MATLABs best approximation of maximising figure window.
shg
end