Take the 2-minute tour ×
Computational Science Stack Exchange is a question and answer site for scientists using computers to solve scientific problems. It's 100% free, no registration required.

I have a comsol model. I want to draw a few plots for different values of a global parameter called plot_z, e.g. if plot_z can have 5 different values I want to draw 5 different plots, one for each value. In each plot I need to write the value of plot_z parameter in the plot title. I have typed many expressions such as plot_z, $plot_z, %plot_z%, etc. in the plot title text box, but unfortunately none of them worked.

Is it even possible to have the value of a global parameter in plot title?

share|improve this question
    
Hi Mehrdad, and welcome to scicomp! Have you tried asking this question on the official COMSOL forum? comsol.com/community –  Paul Dec 20 '12 at 5:03
    
Hi @Paul, well, I am from Iran and as a result of american sanctions against Iran they have suspended my account! –  Mehrdad Dec 20 '12 at 15:03
    
I suspect the answer depends on the version of COMSOL you are working with (since the interaction with Matlab - where such a thing would be easy - changed over time). –  Christian Clason Dec 20 '12 at 16:11
    
I have comsol 4.2. so, Christian, you mean that I need to use matlab for doing this? matlab livelink? –  Mehrdad Dec 21 '12 at 6:49
add comment

1 Answer

In this scenario I would suggest to use matlab livelink. I'm not aware of how to include these global parameters in the comsol figures without loading it into MATLAB. If you do opt to do it in MATLAB, you could use the following code.:
plot(x,y)
title(['Your Title',num2str(plot_z)])
You may also need to change your code to address the different parameters, maybe using a for loop.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.