Function returning ans instead of three outputs
Show older comments
My function is:
function [R,G,B] = MostDistantPixel(pixels)
%rest of code
R = ipixel(1)
G = ipixel(2)
B = ipixel(3)
On the command window it says R = 50, G = 48, and B= 47.
However, it is not returning these outputs and returning only the first output R with a value of 50. How do I fix this?
Accepted Answer
More Answers (1)
Povilas Simonis
on 25 Apr 2021
0 votes
I have similar problem, yet I dont manage to understand how to fix it..
function [Out] =test2(a)
if a>3
Out=a+1;
else
fprintf('Less than 4\n');
end
function gives me ans instead of Out
Categories
Find more on Matrix Indexing 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!