I am relativitly new to MATLAB. Most of my new learnings have been learning how to write and run BASIC Functions. I downloaded this CRC32 bit function from File Exchange and I am having a hard time to run/callout the function.
I am trying to enter a HEX number and return the CRC Calculation in HEX.'
I am trying to calculate the CRC for something like "00060D00"
function crc = crc32(data)
crc = uint32(hex2dec('FFFFFFFF'));
poly = uint32(hex2dec('EDB88320'));
crc = bitxor(crc,uint32(data(i)));
mask = bitcmp(bitand(crc,uint32(1)));
if mask == intmax('uint32'), mask = 0; else mask = mask+1; end
crc = bitxor(bitshift(crc,-1),bitand(poly,mask));
I saved it a new folder and path with nothing in there except this function (crc32.m)
When I click "Run" directly in the "Script" Tab/Window, this is what I get in the Command Window:
Not enough input arguments.
Error in crc32 (line 16)
data = uint8(data);
And takes me to the "Run" and shows this:
Can some explain this to me as well as how to call and use this function? Write a code? What I need to do to run and execute this funtion? How to enter?