| Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) | 
![]()  | 
	
| 		
			
			 | 
		#1 | 
| 
			
			 初级会员 
			
			
			
			注册日期: 2008-04-20 
				
				年龄: 39 
				
					帖子: 16
				 
				
				
				声望力: 18 ![]()  | 
	
	
	
		
		
			
			 
			
			ia是从一个仿真模型中导出的一个量,我要做的是把这个量的频谱显示出来,不知道用什么语句好。 
		
		
		
		
		
		
		
	下面的代码好像是说ia这个量不符合要求,我该怎么做才能正确的把ia的频谱显示出来呢?求助~ t=0:1/512:1;x=ia; y=fft(x);m=abs(y);f=(0:length(y)-1)'*512/length(y); figure(1);subplot(2,1,1),plot(t,x),grid on;title('信号检测'); ylabel('Input \itx'),xlabel('Time'); subplot(2,1,2),plot(f,m); ylabel('Abs. Magnitude'),grid on; xlabel('Frequency(Hertz)') ??? Error using ==> fft Function 'fft' is not defined for values of class 'struct'.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 		
			
			 | 
		#2 | 
| 
			
			 初级会员 
			
			
			
			注册日期: 2008-03-11 
				
				年龄: 42 
				
					帖子: 9
				 
				
				
				声望力: 0 ![]()  | 
	
	
	
		
		
			
			 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 		
			
			 | 
		#3 | 
| 
			
			 普通会员 
			
			
			
			注册日期: 2008-02-26 
				
				年龄: 41 
				
					帖子: 71
				 
				
				
				声望力: 24 ![]() ![]() ![]()  | 
	
	
	
		
		
			
			 
			
			Function 'fft' is not defined for values of class 'struct'.  
		
		
		
		
		
		
		
	难道你的ia是结构体类型?  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 		
			
			 | 
		#4 | 
| 
			
			 初级会员 
			
			
			
			注册日期: 2008-05-13 
				
				年龄: 45 
				
					帖子: 1
				 
				
				
				声望力: 0 ![]()  | 
	
	
	
		
		
			
			 
			
			你的那个ia量的具体值有没有?
		 
		
		
		
		
		
		
		
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 		
			
			 | 
		#5 | 
| 
			
			 初级会员 
			
			
			
			注册日期: 2008-04-20 
				
				年龄: 39 
				
					帖子: 16
				 
				
				
				声望力: 18 ![]()  | 
	
	
	
		
		
			
			 
			
			先谢谢楼上朋友的回复。 
		
		
		
		
		
		
		
	>> whos Name Size Bytes Class Im1 1x1 29240 struct array It1 1x1 29238 struct array ia 1x1 29198 struct array ib 1x1 29200 struct array m 1x1 29220 struct array tout 1000x1 8000 double array w 1x1 29222 struct array 是struct array,怎么把这个转换为FFT需要的数据呢?  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 		
			
			 | 
		#6 | 
| 
			
			 初级会员 
			
			
			
			注册日期: 2008-04-20 
				
				年龄: 39 
				
					帖子: 16
				 
				
				
				声望力: 18 ![]()  | 
	
	
	
		
		
			
			 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 |