File Exchange

image thumbnail

Calculate size

version 1.0.0.1 (1.39 KB) by Santosh Kasula
CALCULATESIZE calculates the size of a MATLAB file for use in the game Cody

1 Download

Updated 01 Sep 2016

View Version History

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 http://www.mathworks.com/matlabcentral/about/cody/

Cite As

Santosh Kasula (2021). Calculate size (https://www.mathworks.com/matlabcentral/fileexchange/34754-calculate-size), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (11)

Shlomo Geva

Guillermo Moreno

Bárbara Menezes

tksss, very useful

auto2060

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.

chris clarhaut

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'

auto2060

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

George Berken

function y = nearZero(x)
y = [];
w = [x(2) x x(end-1)];
J=0;
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);
end
end
y = max(v');
end

Jeevan Thomas

AMITAVA BISWAS

Aurelien Queffurust

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 .

MATLAB Release Compatibility
Created with R2011b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!