How to create a random number in range from 65 to 74 using easy68k? [duplicate] - easy68k

This question already has answers here:
Assembly Random Number within Range using Easy 68K (68000)
(2 answers)
Closed 8 years ago.
I am doing my assignment and get stuck at this problem. Please help me. I just can create a random number from 0 to 74 .

Create a random number 0-9 and then add 65

Related

Round or Floor or Ceiling [duplicate]

This question already has answers here:
sql rounding up to a multiple of 5?
(4 answers)
Closed 11 months ago.
I am trying a number of combinations in order to get to "the next highest number starting with 0" from a particular integer.
I've tried ROUND, CEILING and FLOOR and I can not get any of them to work.
Examples.
17 = 20
11 = 20
204 = 210
1001 = 1010
107 = 110
So basically any value should then return the next 0 valued number AFTER it.
Any help would be greatly appreciated. Thanks
assuming all is int's then you can divide and multiply with 10 to do it
(#i+10)/10*10
Since ceiling only works on 10^0 level, you have to divide, then ceiling, then multiply:
select 10*ceiling(#value/10)

knn compare 2 images matlab [duplicate]

This question already has answers here:
Image comparison - fast algorithm
(12 answers)
Image similarity comparison
(7 answers)
Closed 5 years ago.
I need a help. I don't know how to write a Matlab/Java code compare 2 images using KNN, the result should take "wrong" when image 2 is different than image 1. I have to imporve displacement between x1,x2,x3 and that each subsequent generated image with the same x1,x2,x3 is invalid (Prove that the diameter has increased). Others compare it with histograms. Anybody will help me?

Swift rand is not generating random numbers [duplicate]

This question already has answers here:
Swift rand() not being random
(3 answers)
Closed 6 years ago.
I put rand() in Xcode Playground and it prints the same number 16807 even I run many times and value did not change -> "16807"!
is this a bug?
print(rand())
Mohamed Diaa,
You can make use of library functions like arc4random() or arc4random_uniform() for generating random numbers.
let random = Int(arc4random_uniform(3))
To get random value from 0 to 3
you might have to import Darwin to use it.

Replace cells in one cell variable in Matlab [duplicate]

This question already has answers here:
MATLAB: copy a specific portion of an array
(2 answers)
Closed 7 years ago.
I have one variable (1X30 cell) and I want to replace cells 21 through 30 with cells 21 through 30 from another variable (also 1X30 cell). Can someone help?
You should check out the documentation on cells and on indexing. This is quite a simple task:
C1(21:end) = C2(21:end)
or
C1(21:30) = C2(21:30)

Error:Expression or statement is incorrect--possibly unbalanced (, {, or [ [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 9 years ago.
I am facing problem in
fw=D_w((IND(k,1),IND(k,2));
and W2(k)= ((D_w(IND(k,1),IND(k,2))/D(IND(k,1),IND(k,2))-1)*10)
There is a problem in the watermark extraction process and there is error in the last of the code . Any suggestions .kindly make some modifications in it .
So, we have to protect it from leaking so, they don’t reach to wrong people .We have to find the person responsible for the leakage of data . if the data distributed to the third party found in the public domain ,it might be very serious threat to the owner of the company.
I=imread('girl512.bmp');
subplot(2,3,1),imshow(I,[]),title('Original Image');
wmsz=1000;
I=I(:,:,1);
[r,c]=size(I);
D=dct2(I);
D_vec=reshape(D,1,r*c);
[D_vec_srt,Idx]=sort(abs(D_vec),'descend');
W=randn(1,wmsz);
subplot(2,3,2),plot(W),title('Watermark');
Idx2=Idx(2:wmsz+1);%choosing 1000 biggest values other than the DC
%finding associated row-column order for vector values
IND=zeros(wmsz,2);
for k=1:wmsz
x=floor(Idx2(k)/r)+1;%associated column in the image
y=mod(Idx2(k),r);%associated row in the image
IND(k,1)=y;
IND(k,2)=x;
end
D_w=D;
%WATERMARK EMBEDDING
for k=1:wmsz
fw=D_w((IND(k,1),IND(k,2));
fw=fw+0.1*fw.*W(k);
end
I2=idct2(D_w);%inverse DCT to produce the watermarked asset
I2_int=uint8(I2);
imwrite(I2_int,'I2_watermarkedn.bmp','bmp');
subplot(2,3,3),imshow('I2_watermarkedn.bmp'),title('Watermarked Image');
%WATERMARK EXTRACTION
W2=[];
for k=1:wmsz
W2(k)=((D_w(IND(k,1),IND(k,2))/D(IND(k,1),IND(k,2))-1)*10);
end
subplot(2,3,4),plot(W2),title('Extracted Watermark');
Lets count them:
12 3 4 opens
fw=D_w((IND(k,1),IND(k,2));
1 23 closes
12 3 2 3 21 cumulative
So, yes, they are unbalanced. You need to fix that. I suspect it can be fixed simply by removing one of the two initial ( characters.
12 3 4 5 6 7 8 opens
W2(k)= ((D_w(IND(k,1),IND(k,2))/D(IND(k,1),IND(k,2))-1)*10)
1 23 4 56 7 8 closes
12 3 4 3 4 32 3 4 3 4 32 1 0 cumulative
Those ones aren't unbalanced, in terms of quantity. I can't vouch for the placement since it's rather complex :-)