Search code examples
variablesoctaverename

Renaming a variable in GNU Octave


Let's say I have a variable g in my GNU Octave workspace. How can I rename it to f?

I tried using the rename function but I believe it is for another purpose.


Solution

  • Yeah, rename is for files on the filesystem. To "rename" a variable, just assign it to a new variable and clear the old one.

    f = g;
    clear g