diff --git a/README.md b/README.md index 1cc2dbe..26b1b50 100644 --- a/README.md +++ b/README.md @@ -11,15 +11,17 @@ To use prettify_matlab: prettify_matlab doesn't use any of MATLAB's add-on toolboxes and doesn't have any dependancies. ## :triangular_flag_on_post: Features -### Prettify plots - -Run `prettify_plot;` to prettify your current figure (includes all subplots). Includes options to modify the background color, text size and homogenize x and y limits across plots. - ### Prettify code Run `prettify_current_code;` to prettify your current script open in the MATLAB editor. All code editing rules are stored in the `formatRules.xml` file, where they can easily be changed. - + + +### Prettify plots + +Run `prettify_plot;` to prettify your current figure (includes all subplots). Includes options to modify the background color, text size and homogenize x and y limits across plots. + + ### Prettify colors #### Colorblind simulator diff --git a/examples/uglyCodeExample.m b/examples/uglyCodeExample.m index c369fa4..0d6171d 100644 --- a/examples/uglyCodeExample.m +++ b/examples/uglyCodeExample.m @@ -1,36 +1,13 @@ -function [f, r, t] = uglyCodeExample(n) - % comment - if n < 0 - error('Negative!'); - elseif isinf(n) - error('Too big!'); - end - if ~(isnumeric(n)&& isscalar(n)&& mod(n, 1)== 0) - error('Not a pos int.'); - end - r = 1; - for i = 1:n - r = r * i; - end - f = 0; - g = 1; - for j = 1:n - t = f; - f = f + g; - g = t; - end - t = 0; - for h = 1:n - t = t + h; - end - k = 3; - while k < n - for m = 2:floor(sqrt(k)) - if mod(k, m)== 0 - break - end - if m == floor(sqrt(k)), disp(['Prime ', num2str(k)]) - end - k = k + 1; - end - end \ No newline at end of file +function [f,r,t]=uglyCodeExample(n) +%comment +if n<0,error('Negative!');elseif isinf(n),error('Too big!'),end +if ~(isnumeric(n )&&isscalar( n)&&mod(n,1)== 0),error('Not a pos int.');end,r=1;for i=1:n; +r=r*i;end +f=0; +g=1;for j=1:n; +t=f; +f=f+g; +g=t;end +t=0;for h=1:n; +t=t+h;end,k=3;while k