【发布时间】:2022-11-13 23:51:24
【问题描述】:
嗨,我正在尝试从 MATLAB 中的以下代码中获得两个返回:
function [Xq, SNq] = cuantificacion(x,xmax,xmin,b)
N = input('Introduce un numero de muestras: ');
L = 2^b;
delta = (xmax-xmin)/L;
if(abs(x)<xmax)
Xq = (fix((abs(x)/delta)) + 1/2)*delta*sign(x);
else
Xq = ((L-1)/2)*delta*sign(x);
end
p = 0;
q = 0;
for i = 0:N
p = p+x^2;
q = q + (Xq - x);
end
Px = 1/N*p;
Pq = 1/N*q;
SNq = 10*log(Px/Pq);
end
但我只得到一个回报,我不明白为什么。
【问题讨论】:
-
您肯定将其称为
[return1, return2] = cuantificacion(x,xmax,xmin,b);而不是return1 = cuantificacion(x,xmax,xmin,b);,甚至不是cuantificacion(x,xmax,xmin,b);,对吗?您正在获取返回值吗? -
哦耶!抱歉我刚开始使用MATLAB,谢谢!
标签: matlab