| Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) | 
![]()  | 
	
| 		
			
			 | 
		#1 | 
| 
			
			 初级会员 
			
			
			
			注册日期: 2008-10-27 
				
				年龄: 38 
				
					帖子: 1
				 
				
				
				声望力: 0 ![]()  | 
	
	
	
		
		
			
			 
			
			请问如果知道x和y两组数,如何直接绘制出相应的曲线图?用plot的话出来的是折线图 
		
		
		
		
		
		
		
	记得在帖子上有高人直接用spline,请问如何使用?谢谢  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 		
			
			 | 
		#2 | 
| 
			
			 高级会员 
			
			
			
			注册日期: 2008-11-01 
				
				年龄: 39 
				
					帖子: 406
				 
				
				
				声望力: 27 ![]()  | 
	
	
	
		
		
			
			 
			
			lz 个人建议 可以参考MatlAB中help有关plot的说明 且有例子 
		
		
		
		
		
		
		
	Thx for reading. PS:若还算满意,直接点击“Thanks”,再次登陆时亦便于查看回答是否真的帮到你了。 个人观点 仅供参考 多多交流 相互学习  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 		
			
			 | 
		#3 | 
| 
			
			 高级会员 
			
			
			
			注册日期: 2008-11-07 
				住址: 湖南长沙 
				
				
					帖子: 233
				 
				
				
				声望力: 22 ![]()  | 
	
	
	
		
		
			
			 
			
			spline函数是计算在给定点的插值。 
		
		
		
		
		
		
			Matlab给出了如下的两个例子: Example: This generates a sine-like spline curve and samples it over a finer mesh: x = 0:10; y = sin(x); xx = 0:.25:10; yy = spline(x,y,xx); plot(x,y,'o',xx,yy) Example: This illustrates the use of clamped or complete spline interpolation where end slopes are prescribed. In this example, zero slopes at the ends of an interpolant to the values of a certain distribution are enforced: x = -4:4; y = [0 .15 1.12 2.36 2.36 1.46 .49 .06 0]; cs = spline(x,[0 y 0]); xx = linspace(-4,4,101); plot(x,y,'o',xx,ppval(cs,xx),'-'); 
				__________________ 
		
		
		
		
	坚持就是胜利,努力就有奇迹。  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 		
			
			 | 
		#4 | 
| 
			
			 初级会员 
			
			
			
			注册日期: 2008-09-08 
				
				年龄: 48 
				
					帖子: 9
				 
				
				
				声望力: 0 ![]()  | 
	
	
	
		
		
			
			 
			
			这个主要是关于曲线拟合以及插值的计算,在帮助中查polyfit or interp function!
		 
		
		
		
		
		
		
		
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 |