how to change a particular line of code in a m file

edited February 2008 in Science & Tech
hi ,

i need to change a single line of code in my file with another line. can anyone suggest a way to do it

Comments

  • JBJB Carlsbad, CA
    edited February 2008
    Using Linux?

    sed -e 's/old line/new line/'
  • shwaipshwaip bluffin' with my muffin Icrontian
    edited February 2008
    iirc, you're doing this to a python script. Make the thing you need to change a command line argument to the script.
  • edited February 2008
    JB wrote:
    Using Linux?

    sed -e 's/old line/new line/'

    hi

    i am trying to change a line in the .m file which is read by matlab
  • JBJB Carlsbad, CA
    edited February 2008
    I'm confused. Is this the same problem that you describe here: http://icrontic.com/forum/showthread.php?t=69489?

    If not, why don't you just go into the file and change the line you want to modify?
  • shwaipshwaip bluffin' with my muffin Icrontian
    edited February 2008
    he wants to be able to change it automagically based on some calculated value.

    he shouldn't be doing it this way, though. It should be a parameter/argument to the .py script, or he should rewrite the .m file so it's a function rather than a script.
  • JBJB Carlsbad, CA
    edited February 2008
    shwaip wrote:
    he shouldn't be doing it this way, though. It should be a parameter/argument to the .py script, or he should rewrite the .m file so it's a function rather than a script.

    Agreed.
Sign In or Register to comment.