0
I am having problems creating an object vector in Matlab, the idea is that it is a coordinate vector, i.e. the x and y positions. The goal is to have a vector to access the coordinates in the loops easily, and to have data atomicity to have consistency of which position is x or y. I think you have to use constructor.
Given an input n will be constructed an array of coordinates of size n. 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 n array positions.
It’s not feasible to do this in my case. I got a solution using the java.awt.Point class of java in a java array in Matlab, but I would still like to build the coordinate vector in Matlab itself without relying on Java.
– Igoto
is that it was not very clear your problem, a coordinate vector of space for many types of implementations,s I advise you to demonstrate an example of how you expect this vector to be ...
– ederwander
All right I’ll edit.
– Igoto
give a look if this is more or less what you need ..
– ederwander
I had to use a builder for each class, and if the other had not built anything. However for the effort I will score you.
– Igoto