Very nice file. I had to change the varagin logic since A,B,C,D don't get assigned in some instances.
Also, I copy the functions (NormFrac, TernCoOrds3D etc.) from the main function and made individual .m function files for each. For some reason it was not accessible from within the file.
Very nice work and thank you for sharing!