2016-07-13 8 views
0

Ich habe kürzlich eine Variable gespeichert, die ich als global deklariert hatte und jetzt würde ich nicht mehr wollen, dass es global ist. Jedes Mal, wenn ich es lade, lädt es jedoch als global Variable. Wie kann ich sein global Attribut ändern?Gespeicherte globale Variable als nicht global neu zuweisen

z.B.

load 'madTec.mat' 


whos global 

Name  Size    Bytes Class  Attributes 

    madTec  1x107    960 madtec global 

Antwort

0

Eine Möglichkeit, dies zu tun, eine temporäre Variable wäre, nur gesetzt (nicht global) gleich Ihre globale Variable, deaktivieren Sie Ihre globale Variable, stellen Sie Ihren Mattec gleich der Variable tmp, und speichern Sie Ihre neue matTec.mat und einfach neu laden. Es wird keine globale Variable mehr sein.

tmp = madTec; 
clear madTec; 
matTec = tmp; 
save('matTec.mat');