MATLAB: Creating table in matlab of elliptic curve points

elliptic curve

I get the points of elliptic curve and then when I try to convert that 1D array into 2D and try to make a table some error appears need help here is an example of code
if true
% code
end
disp('y^2 = x^3 + 5376x + 2438 mod 123457')
a=0:123456
left_side = mod(a.^2,123457);
right_side = mod(a.^3+5376*a+2438,123457);
points = [];
for i = 1:length(right_side)
I = find(left_side == right_side(i));
for j=1:length(I)
points = [points;a(i),a(I(j))];
end
end
plot(points(:,1),points(:,2),'ro')
set(gca,'XTick',0:1:123456)
set(gca,'YTick',0:1:123456)
grid on;
Z=reshape(points,[256,482])

Best Answer

You are asking to reshape a 123387 by 2 array into a 256 x 482 array. The number of elements in the array is not divisible by 256 or 482 -- it is just slightly less than 482 * 256 * 2