I have a problem, I want to allocate a block of memory of size m and n (so a 2D matrix) where each element of the matrix is a struct of 2 variables ( a point with 2 double coordinates x and y). The language I want to write this in is MATLAB I have tried something like this:
left = zeros(height, width);
for i = 1 : width
for j = 1 : height
var.x = someValue;
var.y = someOtherValue;
left(i,j) = var;
The piece of code from above doesn't work.. How can I fix the problem?