Cellfun for different sizes inputs
显示 更早的评论
I have x number of vectors and I need to count their distance to y number of vectors, I cant use cellfun like this
cellfun(vzdalenost,num2cell(mi,2),num2cell(vstup,2))
because num2cell(mi,2) and num2cell(vstup,2) doesn't have same sizes. Is there a way to do this without using for cycle?
4 个评论
KL
2017-11-19
What exactly do you want to do? even cellfun is an implicit way of using loops.
Jakub Matousek
2017-11-19
Matt J
2017-11-19
It's faster
Don't think so...
Stephen23
2017-11-19
"It's faster..."
Nope. Usually cellfun is slower than a loop.
"...and it looks better."
Perhaps, but it depends on what you are doing.
回答(1 个)
Matt J
2017-11-19
0 个投票
类别
在 帮助中心 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!