-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathplot_model.m
More file actions
33 lines (25 loc) · 811 Bytes
/
plot_model.m
File metadata and controls
33 lines (25 loc) · 811 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
33
function plot_model()
% ran this first: grep -v [A-Za-df-z] design.mat | grep [0-9] > design.mtx
maindir = pwd;
designf = fullfile(maindir,'data','design.mtx');
design = load(designf);
normed_design = design;
for i = 1:size(normed_design,2)
normed_design(:,i) = rescale(normed_design(:,i),1,2);
end
%normed_design = design;
%y = 2*(x - min(x(:))/(max(x(:)) - min(x(:))) - 1);
%normed_design = y;
for i = 1:size(normed_design,2)
normed_design(:,i) = normed_design(:,i) + i*1; %sets the spacing without changing variance/range
%plot(normed_design(:,i))
end
figure,plot(normed_design)
keyboard
end
function C = rescale(A,new_min,new_max)
% rescales entire matrix.
current_max = max(A(:));
current_min = min(A(:));
C =((A-current_min)*(new_max-new_min))/(current_max-current_min) + new_min;
end