Reputation:
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.
Upvotes: 0
Views: 891
Reputation: 1
You can change the name of one variable with assignin
:
assignin ('base', 'new_name_variable', old_name_variable)
Upvotes: 0
Reputation: 23898
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
Upvotes: 3