Multiple output function only returning s
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
the cyclist
2014-1-9
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)
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!