File Exchange

image thumbnail

Calculate size

version (1.39 KB) by

CALCULATESIZE calculates the size of a MATLAB file for use in the game Cody

3 Ratings



View License

CALCULATESIZE(FILENAME) determines the number of nodes in the parse tree associated with the file FILENAME for use in the game Cody. For more information on Cody, refer to

Comments and Ratings (8)

yao gang

Thank you,chris.
I thought the size of function has something to do with input arguments,I was wrong.
calculateSize(''myfile.m') is just ok.

I know this is almost a year later but I had the same problem as yao in that I had trouble getting this program running.
If you want to check the size of your file create a variable called fileName and assign the file you want to check like this
fileName = 'myfile.m'

yao gang

Could you give an example to explain how to use this funtion?I have no idea how to deal with functions with input arguments.Always has errors.Thank you.


Brad (view profile)

George Berken

function y = nearZero(x)
y = [];
w = [x(2) x x(end-1)];
for I = 2:(length(w)-1)
if ((w(I)~=0)&&((w(I-1)==0)||(w(I+1)==0)))
J = J + 1;
v(J) = w(I);
y = max(v');

size of calculateSize.m is 21 ;)

One comment : I would not use the size variable as output of this function since size is a MATLAB function name .


Updated license

MATLAB Release
MATLAB 7.13 (R2011b)
Tags Add Tags

MATLAB Online Live Editor Challenge

Win cash prizes and have your live script featured on our website

Learn more

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video