please tell how to represent xi-1^2. i.e not xi-(2). i want x(i-2)

댓글 수: 1

Stephen23
Stephen23 2016년 2월 25일
편집: Stephen23 2016년 2월 25일
It is not clear what you want, because you have written two different things. No matter how many times your exponentiate 1 (e.g. your example 1^2) the output will never equal 2.
MATLAB does not have implicit multiplication, so you need to use a * sign.

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

답변 (1개)

Stephen23
Stephen23 2016년 2월 25일

0 개 추천

Do you want this:?
>> x = 3;
>> x*(1i-2)
ans = -6 + 3i

댓글 수: 2

praveena maddamsetty
praveena maddamsetty 2016년 2월 25일
no what i want is if you have any idea regarding bbs algorithm then you can get my point. i want to code the bbs algorithm
Stephen23
Stephen23 2016년 2월 25일
편집: Stephen23 2016년 2월 25일
The BBS algorithm is trivial, but keep in mind the limits of floating-point numbers!
N = 6;
M = 987654321;
X = 123456789
for k = 1:N;
X = mod(X^2,M)
end
displays this in the command window:
X = 123456789
X = 478395062
X = 281394656
X = 325603120
X = 147470912
X = 750037428

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

카테고리

도움말 센터File Exchange에서 App Building에 대해 자세히 알아보기

질문:

2016년 2월 25일

편집:

2016년 2월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by