Multiple output function only returning s

1 view (last 30 days)
function [s,n] = candy(p, k)
n = rem(p,k);
s = fix(p/k);
end
so here's my funtion i run it and it only outputs s how do i get it to output s and n

Accepted Answer

the cyclist
the cyclist on 9 Jan 2014
How you you call this function? It should be
[s,n] = candy(p_in,k_in)
when you call it, not just
candy(p_in,k_in)

More Answers (0)

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!