Too many output arguments problem
显示 更早的评论
I have a very simple too many output arguments problem but I could not fix this: I create a function whose name is myrand as
function myrand
a = 1+rand(3,4)*9
end
and I saved it. When I try to run myrand, there is no problem. However, I cannot use this function with other operators and cannot use it as an element for different functions. For example, when I assign b as b = myrand, then I encounter "too many output arguments" error. I am very appreciated if one help me for solution of this problem.
回答(1 个)
per isakson
2017-9-30
编辑:per isakson
2017-9-30
Replace
function myrand
a = 1+rand(3,4)*9
end
by
function a = myrand
a = 1+rand(3,4)*9;
end
2 个评论
Hadjer BEN BRAHIM
2021-9-14
Didnt work for me ! Any help please ?
Works for us.
b = myrand()
function a = myrand
a = 1+rand(3,4)*9;
end
类别
在 帮助中心 和 File Exchange 中查找有关 Variables 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!