Using Java generic classes in Matlab

后端 未结 3 1748
慢半拍i
慢半拍i 2021-01-05 07:24

Is it possible to construct a parameterized class in Matlab? For example in Java I could say ArrayList myList = new ArrayList(). I h

3条回答
  •  萌比男神i
    2021-01-05 08:16

    I am not a specialist in Matlab but I understand something in java.

    1. Generics are supported since java 5
    2. Generics are compile time feature. They are also called "erasures".

    It means that

    1. Check which java is installed on your system and used by matlab. Probably it is configured to use java 1.4?
    2. Can you write you code using other IDE (not matlab), compile it their and then use in Matlab? Probably it will fix your problem.

    The following link could probably help you: http://www.mathworks.com/support/solutions/en/data/1-1812J/

提交回复
热议问题