I was trying to use a list in matlab and I found this post:MATLAB linked list
it seems like matlab can use java. given that I do
a=java.util.linkedList;
a.add(2);
a.add(3);
a.add(5);
and I get in a the 3 elements. The problem comes when I want to remove one of them. Let's say I want to remove 2.
if I cast
a.remove(2)
matlab removes me 5,since it sees 2 as an index.
In java I'd cast the int to Integers,but I can't manage to do it in Matlab (I can't even use the constructor, in java I'd do linkedList<Integer> a=new linkedList<Integer>()
and then cast 2 to Integer and it should work)
is there any way I can solve this issue?