| Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) | 
![]()  | 
	
| 
	 | 
| 		
			
			 | 
		#1 | 
| 
			
			 初级会员 
			
			
			
			注册日期: 2009-06-19 
				
				年龄: 37 
				
					帖子: 2
				 
				
				
				声望力: 0 ![]()  | 
	
	
	
		
		
			
			 
			
			对图像预测编码,程序运行后出现上述错误提示。 
		
		
		
		
		
		
		
	Undefined function or method 'LPCencode' for input arguments of type 'double' 请问如何解决。编码如下: X=imread('lena.bmp','bmp'); X=double(X); Y=LPCencode(X); XX=LPCdecode(Y); figure(1);imshow(mat2gray(Y)); e=double(X)-double(XX); [m,n]=size(e); erms=sqrt(sum(e(:).^2)/(m*n)); figure(2); [h,x]=hist(X(:)); subplot(121);bar(x,h,'k'); [h,x]=hist(Y(:)); subplot(122);bar(x,h,'k'); function y=LPCencode(x,f) error (nargchk(1,2,nargin)) if nargin<2 f=1; end x=double(X); [m,n]=size(x); p=zeros(m,n); xs=x zc=zeros(m,1); for j=1: length(f) xs=[zc xs(:, 1: end-1)]; p=p+f(j)*xs; end y=x-round(p); funtion x=LPCdecode(y,f) error(nargchk(1,2,nargin)); if nargin<2 f=1; end f=f(end: -1: 1); [m,n]=size(y); order=length(f); f=repmat(f,m,1); x=zeros(m,n+order); for j=1: n jj=j+order; x(:,jj)=y(:,jj+round(sum(f(:,order: -1; 1).*x(:, (jj-1): -1: (jj-order)),2)); end x=x(:, order+1: end);  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 		
			
			 | 
		#2 | 
| 
			
			 高级会员 
			
			
			
			注册日期: 2008-11-01 
				
				年龄: 39 
				
					帖子: 406
				 
				
				
				声望力: 27 ![]()  | 
	
	
	
		
		
			
			 
			
			lz LPCencode( )函数是被调用的子函数 应当是自己另外编写的 在set path为默认情况的前提下 根据lz代码所示 该段代码所在文件夹若无LPCencode.m文件 则应会出现该错误提示 
		
		
		
		
		
		
		
	Thx for reading. PS:若还算满意,直接点击“Thanks”,再次登陆时亦便于查看回答是否真的帮到你了。 通过点击本人帖子旁边的ID 可以使用“发送悄悄话给silas_xue”与我进行联系 个人观点 仅供参考 多多交流 相互学习  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 		
			
			 | 
		#3 | 
| 
			
			 初级会员 
			
			
			
			注册日期: 2009-06-19 
				
				年龄: 37 
				
					帖子: 2
				 
				
				
				声望力: 0 ![]()  | 
	
	
	
		
		
			
			 
			
			嗯。知道了。多谢指点。。
		 
		
		
		
		
		
		
		
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 |