Hi, I'm just trying to change this

`for i = 1:N j = i:N; D(i,j) = euclideandistance(X(i,1),X(i,2),X(j,1),X(j,2));end`

to a parfor loop, but I can't figure out how to do it

Skip to content# MATLAB: How to transform a simple for into a parfor

###### Related Question

parallel computingParallel Computing Toolboxparfor

Hi, I'm just trying to change this

`for i = 1:N j = i:N; D(i,j) = euclideandistance(X(i,1),X(i,2),X(j,1),X(j,2));end`

to a parfor loop, but I can't figure out how to do it

- Vectorizing nested for loops
- Nested for loop in parfor, indexing
- Unable to perform assignment because the left and right sides have a different number of elements.
- Problem in Using Parallel Feature for a “For Loop”!
- Hey, need help in filtering an image using PARFOR, been getting an error saying the varible hatx in a parfor cannot be classified.

## Best Answer