Reputation: 149
I am trying to access the output of a function from another function. I have the following function:
function f = doSomething
f = 5+6;
In another function I'm calling doSomething as follows:
doSomething;
Is there a way to get the value of f
? I want to read the output of doSomething and display it.
Upvotes: 0
Views: 93
Reputation: 3845
Write
output = doSomething();
to store the result to the variable "output", and
fprintf('%d\n',output);
to display it.
Upvotes: 1