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
KL 2017년 11월 19일
What exactly do you want to do? even cellfun is an implicit way of using loops.
It's faster and it looks better. I want a table of distances:
x1 x2
y1
y2
y3
y4
Matt J
Matt J 2017년 11월 19일
It's faster
Don't think so...
Stephen23
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
Matt J 2017년 11월 19일

0 개 추천

Consider using IPDM (Download) instead.

카테고리

도움말 센터File Exchange에서 Structures에 대해 자세히 알아보기

질문:

2017년 11월 19일

댓글:

2017년 11월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by