1. It is easy. It can be done by using functions-even the top level script should also be written as a function. An example is given below:
All these functions are present in Top.m
function Top
a = GetValue(1);
b = GetValue(2);
s = Sum2Num(a,b)
end
function val = GetValue(n)
val = n;
end
function s = Sum2Num(a,b)
s = a + b;
end
All these functions are present in Top.m
function Top
a = GetValue(1);
b = GetValue(2);
s = Sum2Num(a,b)
end
function val = GetValue(n)
val = n;
end
function s = Sum2Num(a,b)
s = a + b;
end
No comments:
Post a Comment