Please login with a confirmed email address before reporting spam
     
    
 
                                                Posted:
                            
                                1 decade ago                            
                            
                                2011/05/03 9:07 GMT-4                            
                        
                        
                                                    Hi Saeid,
Try looking in the COMSOL LiveLink™ for MATLAB® User's Guide at the following commands to see if they do what you want:
  1. mpheval
  2. mphinterp
The first one pulls results at specified node points, the second one pulls results at arbitrary points.
This is the code I use for extracting the electric field at specified coordinates:
fieldMap(:,1:3) = coordinates;
[fieldMap(:,4),fieldMap(:,5),fieldMap(:,6)] = mphinterp(model, {'es.Ex','es.Ey','es.Ez'}, 'coord', coordinates.');
This comes from a function with is available on launchpad at 
bazaar.launchpad.net/~mattachu/modelrfq/trunk/view/head:/Matlab/ComsolInterface/getFieldMap.m
Hope it helps!
matt                                                
                            Hi Saeid,
Try looking in the COMSOL LiveLink™ for MATLAB® User's Guide at the following commands to see if they do what you want:
  1. mpheval
  2. mphinterp
The first one pulls results at specified node points, the second one pulls results at arbitrary points.
This is the code I use for extracting the electric field at specified coordinates:
fieldMap(:,1:3) = coordinates;
[fieldMap(:,4),fieldMap(:,5),fieldMap(:,6)] = mphinterp(model, {'es.Ex','es.Ey','es.Ez'}, 'coord', coordinates.');
This comes from a function with is available on launchpad at http://bazaar.launchpad.net/~mattachu/modelrfq/trunk/view/head:/Matlab/ComsolInterface/getFieldMap.m
Hope it helps!
matt                        
                                                
                                                                                                            
                                             
                                            
                                                
    
        Please login with a confirmed email address before reporting spam
     
    
 
                                                Posted:
                            
                                1 decade ago                            
                            
                                2011/05/08 3:25 GMT-4                            
                        
                        
                                                    Hi mattachu, 
  Thanks for you reply. 
   I use Comsol 3.5a and Matlab 2008. I can connect this two programs, but when I save my model in .m format and run it in Matlab, I have not obtained any results!!!   
   I am not sure that if it is because of Comsol and Matlab programs or I have any other problems in my modeling?! I have attached my mfile to this message, Would you please check it?!
   Input and outputs of this mfile should be 40*1 vectors. 
  Thanks,
  Saeid                                                
                                                
                            Hi mattachu, 
  Thanks for you reply. 
   I use Comsol 3.5a and Matlab 2008. I can connect this two programs, but when I save my model in .m format and run it in Matlab, I have not obtained any results!!!   
   I am not sure that if it is because of Comsol and Matlab programs or I have any other problems in my modeling?! I have attached my mfile to this message, Would you please check it?!
   Input and outputs of this mfile should be 40*1 vectors. 
  Thanks,
  Saeid                        
                                                
                        
                                                
                                                                                                            
                                             
                        
                        
                                                
    
        Please login with a confirmed email address before reporting spam
     
    
 
                                                Posted:
                            
                                1 decade ago                            
                            
                                2011/05/09 3:06 GMT-4                            
                        
                        
                                                    
   I use Comsol 3.5a and Matlab 2008.
Ah, I'm sorry then, I only have experience with extracting data from Comsol 4. Unfortunately the functions I mentioned above are only available in later versions of Comsol. When I used to use Comsol 3.5a I just extracted data manually rather than using Matlab.
Hopefully someone else will have the knowledge to help you.                                                
 
                                                
                            [QUOTE]
   I use Comsol 3.5a and Matlab 2008.
[/QUOTE]
Ah, I'm sorry then, I only have experience with extracting data from Comsol 4. Unfortunately the functions I mentioned above are only available in later versions of Comsol. When I used to use Comsol 3.5a I just extracted data manually rather than using Matlab.
Hopefully someone else will have the knowledge to help you.