converting points on cell array

조회 수: 1 (최근 30일)
sadiqa ilyas
sadiqa ilyas 2019년 8월 17일
댓글: sadiqa ilyas 2019년 8월 19일
Hi I want to display points as cell. but it gives error at t
for i=0:n-1
t=(find({Y2}=={(X(i+1))}));
if (~isempty(t))
temp=[ones(1,length(t)).*i; t-1];
.
.
error at
t=(find({Y2}=={(X(i+1))}));
Undefined operator '==' for input arguments of type 'cell'
Can anyone tell me whats wrong here
  댓글 수: 6
Are Mjaavatten
Are Mjaavatten 2019년 8월 19일
What do you mean by points? And why use cell arrays?
I have modified your code so that it runs, but this may not be what you want. Could you explain in more detail what you are attempting to do?
n = 4;a = 1; b = 3;
Y2 = cell(n,1);X=cell(n,1);
for x=1:n
Y2{x} = powermod(x,2,n);
X{x} = mod(x^3+a*x+b,n);
end
E=[];
for i=0:n-1
t=find(cell2mat(Y2)==X{i+1});
if (~isempty(t))
temp=[ones(length(t),1)*i; t-1];
E=[E temp];
end
end
sadiqa ilyas
sadiqa ilyas 2019년 8월 19일
I am using cell because i am trying to do mapping using elliptic curves. The code you have written gives me points like
0 1 2
0 1 2
0 0 0
2 2 2

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

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by