필터 지우기
필터 지우기

table having entries as points of elliptic curves

조회 수: 1 (최근 30일)
Muhammad Sohail Abid
Muhammad Sohail Abid 2018년 7월 3일
댓글: Muhammad Sohail Abid 2018년 7월 3일
I have 123387x2 arrays entries of elliptic curve points. I want to make a table of mxn order and also have to neglect the points having same x value, only take one point for each x-value
  댓글 수: 2
KSSV
KSSV 2018년 7월 3일
How you are plotting ellipse?
Muhammad Sohail Abid
Muhammad Sohail Abid 2018년 7월 3일
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;

댓글을 달려면 로그인하십시오.

채택된 답변

Mridul G
Mridul G 2018년 7월 3일
I assume you have 123387 (x,y) points, want to filter out points with the same x coordinate (pick one randomly for each x value), and then store it an appropriate table such that each cell contains an (x,y) tuple. You can first convert the matrix to a table, which would make life easier. The following might help:
mat = randi(100,100,2); %sample points
a = array2table(mat);
a = sortrows(a);
A = table2array(a);
[B, ia] = unique(A(:,1));
C = A(ia,2);
D = [B C];
%now you have your unique points, insert them into your m x n table as required

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Discrete Math에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by