Do you have some sort of model for the fruit? Maybe an OBJ or STL? If so, there are some functions available for download from the Mathworks website to important those files. From there, you will have lists of the faces and vertices. It the fruit is oriented correctly, all you have to do is calculate the distance between the extreme most points.