Does Matlab have a kind of with…end command? http://msdn.microsoft.com/en-us/library/wc500chb(v=vs.80).aspx
I have a variable in my workspace which contains a lot of nested data. Now I don’t want to have to type this all the time:
Root.ChildLevel1.A = Root.ChildLevel1.B + Root.ChildLevel1.C
But rather something like:
with Root.ChildLevel1
A = B + C
end
is this possible?
I’m not aware of such functionality in Matlab.
What you can do is
Edit:
According to comment by @Nick, if
Root.ChildLevel1is not subclass ofhandle,then one should add the following line:
I would also recommend to
at the end.