Quantcast
Channel: Latest Discussions - COMSOL Forums
Viewing all articles
Browse latest Browse all 26527

LiveLink matlab, how to plot field distributions?

$
0
0
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

Viewing all articles
Browse latest Browse all 26527

Trending Articles