Why does my matlab function produce result more than I expect?
Show older comments
Please see the attached pdf file for the issue. Thanks!
Accepted Answer
More Answers (1)
Your function Testing has two outputs, and when you call the function the first output is displayed by default, unless you suffix the line with a semicolon. So instead of calling this:
Testing
you need to call this:
Testing;
Note that a function output is a totally different thing to the text that you are fprintf-ing in the command window: do not get confused between these.
3 Comments
Ben Le
on 10 Jan 2016
Stephen23
on 10 Jan 2016
My pleasure. You can also vote for my answer if it helped you.
Andrei Bobrov
on 11 Jan 2016
+1
Categories
Find more on MATLAB Report Generator 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!