How to share a variable from one method to another method?
Show older comments
classdef Sample
properties
a
b
end
methods
function f1 = form1(this)
f1 = 1 ./ this.a; % how to share this variable to other methods (in this example form2)?
end
function f2 = form2(this)
f2 = f1 .^ 2;
end
end
end
Accepted Answer
More Answers (0)
Categories
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!