IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
rows_cols.m
Go to the documentation of this file.
1 %>@ingroup graphicsapi
2 %>@file
3 %>@brief rows_cols
4 %
5 %> @param num
6 %> @param proportion
7 %> @return [r, c]
8 function [r, c] = rows_cols(num, proportion)
9 
10 % num = ceil(num/2)*2; % "rounds" num to the next integer
11 
12 MULT = 10000; % improves precision
13 
14 r = round(sqrt(num*proportion*MULT));
15 c = ceil(num*MULT/r);
16 
17 r = ceil(r/sqrt(MULT));
18 c = ceil(num/r);
19 
function rows_cols(in num, in proportion)