Added support for all numeric array types except for complex and sparce matrices and refactored double code
added support for character arrays (but still not cell arrays)