I'm having problems creating a vector of objects in Matlab, the idea being that it is a vector of coordinates, i.e. the positions x and y. The goal is to have a vector to access the coordinates in the loops easily, and have the atomicity of the data to have consistency of which position is x or y. I think you have to use constructor.
Given an input n, an array of coordinates of size n will be constructed. In which each element will have its own x and y. Ex:
n=2;
vetor(n)=coord(0,0);
vetor(1).x=5;vetor(1).y=3;
vetor(2).x=2;vetor(2).y=4;
The main issue is that I want to leave the vector instance in another class, which will have to have in the constructor the allocation of this array of n positions.