Friday, July 17, 2015

Soo, Entry #3, More Codes

During the past couple days, I've continued working on my codes to efficiently make multiple boxplots (description about the boxplots is in entry #2). For the code, I mainly used MatLab, but since I am more familiar with java, I sometimes used java to write a draft version of the code, then changed the format to run the code with MatLab. 

These (lines below) are parts of my code:

rowThick = 50;
UT = triu(ones(rowThick, rowThick),1);
[ib] = find(UT>0);
randomX = randperm(numel(ib));
[i,j] = ind2sub([rowThick,rowThick],ib(randomX(1:20)));
-> This code picks out position of 20 random data pairs out of 2500.

for count = 1:20;
  Z(count,1) = zrand(thick(i(count),:), thick(j(count), :));
end
-> This code calculates the zrand score of the picked 20 data pairs, and stores the result in the matrix Z

scatter(x(:), y(:), 10, 'black', 'filled');
hold on;
boxplot(y,x,'labels', {});
hold off;

-> This code uses matrix x and y to plot boxplots and data points (scatter plot).

No comments:

Post a Comment