很明显
if (q>0)
output1(4*k)=1
else
output1(4*k)=0
你这里输出全是0和1
output1(4*k+1:4*k+3)=dec2bin(abs(q),3)
你这里肯定是又把某些符合条件(4*k+1:4*k+3)的输出直接赋值为48,49了(你后面的那个函数我不知道是什么)。
如果这不是你要的结果,好好看看那个dec2bin(abc(q),3),你肯定会找到问题。
把你的5*16矩阵给出来,一下完成,这里用x代替。x=round(10*(rand(5,16)+rand(5,16)-rand(5,16)))
mx=max(max(x)),mn=min(min(x))
H=3L=1
y=(H-L)/(mx-mn)*(x-mn)+L
结果:
x =
-2 7 6-5 8 5-1 2 0-7 3 010 8 9 2
5-3 3 4 6 5 011 0 8-4 4 01016 2
8-4 1 9 912 010 6 7 2 9 8 8 7 6
9-110 6 5 815 7 0 0-1 510 413 4
1 8 3 112 8 9 7 3 0 7 5 7 6 4 5
mx =
16
mn =
-7
y =
Columns 1 through 12
1.43482.21742.13041.17392.30432.04351.52171.78261.60871.00001.86961.6087
2.04351.34781.86961.95652.13042.04351.60872.56521.60872.30431.26091.9565
2.30431.26091.69572.39132.39132.65221.60872.47832.13042.21741.78262.3913
2.39131.52172.47832.13042.04352.30432.91302.21741.60871.60871.52172.0435
1.69572.30431.86961.69572.65222.30432.39132.21741.86961.60872.21742.0435
Columns 13 through 16
2.47832.30432.39131.7826
1.60872.47833.00001.7826
2.30432.30432.21742.1304
2.47831.95652.73911.9565
2.21742.13041.95652.0435
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)