From owner-help-octave at bevo dot che dot wisc dot edu Fri Dec 1 20:14:30 1995 Subject: This cant be right! Was String Manipulations From: John L Daschbach To: Octave Help List Date: Fri, 01 Dec 1995 18:12:13 -0800 (PST) John Utz wrote: >HI again this is just too weird > >function fig ( functionname) > >% create the name of the file. >prestring = strcat ( functionname, ".fig" ) >prefilenamestr = strcat ( """", prestring ) >filenamestr = strcat ( prefilenamestr, """" ) > >OUTPUT: is this how this is supposed to work? > >octave:16> fig ("foo") >prestring = foo.fig >prefilenamestr = "foo.fig >filenamestr = "foo.fig" >octave:17> Here is how I do it, there may be others. This is just an example. Note the use of sprintf() and eval() # # Now set up the plot # fbstring = sprintf("set nolabel"); eval(fbstring); fblabelx = min(X) + 0.1 * (max(X) - min(X)); fblabely = min(Y) + 0.8 * (max(Y) - min(Y)); fbstring = sprintf("set label \"% .3f\" at %e, %e",flatband,fblabelx,fblabely); eval(fbstring); Hope this helps. -John