From: aman on 3 Aug 2010 19:42 Thanks alot it was a great help, can we do something similar with save as command ...?? I am analyzing data for every month with multiple plots,so, every time I have to change month name in my save option before executing my code.So, is there any way I can set variable for that and just vary that.I will appreciate any kind of help. Thanks in advance. Aman "John" <sjohn(a)cnbc.cmu.edu> wrote in message <gvp68d$3ng$1(a)fred.mathworks.com>... > Use sprintf to format your title string - > > str = sprintf('Plot with frequency = %f , and wavelength = %f',number,number2); > title(str); > > "Juliette Salexa" <juliette.physicist(a)gmail.com> wrote in message <gvp578$p93$1(a)fred.mathworks.com>... > > Let's set the variable number=5. > > > > If I write underneath a plot command "title(number)" > > The title ofmy plot is 5 > > > > Now what if I want to do something like "title('plot with frequency set to equal' number)" > > > > The overall goal is to have the title being "Plot with frequency = number , and wavelength = number2 " > > > > where number and number2 are predefined variables. > > > > Any ideas ??
From: Jan Simon on 3 Aug 2010 20:44 Dear Aman, > Thanks alot it was a great help, can we do something similar with save as command ...?? > I am analyzing data for every month with multiple plots,so, every time I have to change month name in my save option before executing my code.So, is there any way I can set variable for that and just vary that. Do you mean the SAVEAS command? Or with "save" as command? What is "change month name in my save option"? You can use SPRINTF to create a file name for the SAVE or SAVEAS commands. Kind regards, Jan
|
Pages: 1 Prev: Newton Raphson method for chemical equilibrium system Next: how to get rid of array index |