Added correcting \ for / in input paths
This commit is contained in:
		
							parent
							
								
									3c66006505
								
							
						
					
					
						commit
						9d56441c79
					
				| @ -11,8 +11,11 @@ function [Data,params] = load_bruker(path) | |||||||
| % | % | ||||||
| %   Note that this funtion is dependent on easyspin. | %   Note that this funtion is dependent on easyspin. | ||||||
| 
 | 
 | ||||||
|  | %correct \ for / | ||||||
|  | corrpath = replace(path,"\","/"); | ||||||
|  | 
 | ||||||
| %load Bruker data with help of easyspin | %load Bruker data with help of easyspin | ||||||
| [bruker_axes,Data,bruker_params] = eprload(path); | [bruker_axes,Data,bruker_params] = eprload(corrpath); | ||||||
| 
 | 
 | ||||||
| %assign metadata to custom params struct | %assign metadata to custom params struct | ||||||
| params.Field_Center = bruker_params.YMIN + 0.5*bruker_params.YWID; | params.Field_Center = bruker_params.YMIN + 0.5*bruker_params.YWID; | ||||||
|  | |||||||
| @ -7,7 +7,10 @@ function [Data,params] = load_matlab(path) | |||||||
| %   string. The extracted name is appended to the 'params' struct, whos | %   string. The extracted name is appended to the 'params' struct, whos | ||||||
| %   contents are displayed in the command window afterwards. | %   contents are displayed in the command window afterwards. | ||||||
| 
 | 
 | ||||||
| load(path,'Data','params') | %correct \ for / | ||||||
|  | corrpath = replace(path,"\","/") | ||||||
|  | 
 | ||||||
|  | load(corrpath,'Data','params') | ||||||
| 
 | 
 | ||||||
| %get filename for further documentation and exporting figures | %get filename for further documentation and exporting figures | ||||||
| dataname = string(extractBefore(extractAfter(path,asManyOfPattern(wildcardPattern + "/")),'.')); | dataname = string(extractBefore(extractAfter(path,asManyOfPattern(wildcardPattern + "/")),'.')); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user