Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.
Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
LiveLink matlab, how to plot field distributions?
Posted 16 ago 2012, 04:51 GMT-4 RF & Microwave Engineering, Interfacing, LiveLink for MATLAB, Results & Visualization Version 4.3 1 Reply
Please login with a confirmed email address before reporting spam
Hi,
I am considering an optical fiber in 2D, where I calculate eigenmodes using the RF module and do a sweep of the wavelength in Matlab using a for loop. Inside the for loop I only have the parameters that changes with wavelength. The geometry does not change, and therefore I put it outside the for loop. I have the impression from the user guide that this is the way to do it. Do you agree or are there some problems related to this? It seems to find the right solution.
My problem is that I would like to plot the field distribution for every wavelength. But I cannot seem to figure it out. I have tried to create a plot group, but I get an error when setting the solnum regardless of this is done inside or outside the for loop. I have also tried with mpheval where I then have the field distrbution as a data set, and plot it with mphplot. Also this is not optimal, since I cannot see the geometry structure, put on a colorbar or remove the mesh from the plot.
Does anyone know how to do a plot when having a for loop in matlab?
Thank you in advance.
Best regards
Mette
I am considering an optical fiber in 2D, where I calculate eigenmodes using the RF module and do a sweep of the wavelength in Matlab using a for loop. Inside the for loop I only have the parameters that changes with wavelength. The geometry does not change, and therefore I put it outside the for loop. I have the impression from the user guide that this is the way to do it. Do you agree or are there some problems related to this? It seems to find the right solution.
My problem is that I would like to plot the field distribution for every wavelength. But I cannot seem to figure it out. I have tried to create a plot group, but I get an error when setting the solnum regardless of this is done inside or outside the for loop. I have also tried with mpheval where I then have the field distrbution as a data set, and plot it with mphplot. Also this is not optimal, since I cannot see the geometry structure, put on a colorbar or remove the mesh from the plot.
Does anyone know how to do a plot when having a for loop in matlab?
Thank you in advance.
Best regards
Mette
1 Reply Last Post 16 ago 2012, 05:07 GMT-4