Cellfun for different sizes inputs

3 Ansichten (letzte 30 Tage)
Jakub Matousek
Jakub Matousek am 19 Nov. 2017
Kommentiert: Stephen23 am 19 Nov. 2017
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 Kommentare
Matt J
Matt J am 19 Nov. 2017
It's faster
Don't think so...
Stephen23
Stephen23 am 19 Nov. 2017
"It's faster..."
Nope. Usually cellfun is slower than a loop.
"...and it looks better."
Perhaps, but it depends on what you are doing.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Matt J
Matt J am 19 Nov. 2017
Consider using IPDM (Download) instead.

Kategorien

Mehr zu Structures finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by