Does specifying the input parameters in a function call in terms of output of other functions affect performance? 
Would the peak memory usage be affected?
Would it be better if I use temporary variables and clear them after each intermediate step has been calculated?

For ex:

```
g=imfill(imclearborder(imdilate(Inp_img,strel('square',5))),'holes');

```

or 

```
temp1=imdilate(Inp_img,strel('square',5));
temp1=imclearborder(temp1);
g=imfill(temp1,'holes');
clear temp1

```

Which would be better in terms of peak memory usage and speed?