# How to calculate the volume of a facet using convhulln() function?

2 views (last 30 days)

Show older comments

Abdul Suleman
on 18 Dec 2016

Answered: Abdul Suleman
on 22 Dec 2016

##### 3 Comments

John D'Errico
on 18 Dec 2016

oops. Not even a cube. Still asleep I guess. Yes, the enclosed volume is zero.

The issue is if the OP is looking to compute a 2-d "volume" of this object, in the plane of the square, thus the area. We don't really know what they are looking to get here.

### Accepted Answer

Image Analyst
on 22 Dec 2016

##### 0 Comments

### More Answers (2)

Soumya Saxena
on 21 Dec 2016

I understand that you are getting an error with the "qhullmx" function while calling the "convhulln" function. You are defining 4 points in a 3D space as follows:

X= [0 0 0; 1 0 0; 1 1 0; 0 1 0]

However, all inputs have the 3rd dimension as 0. The z coordinate is 0. So,these become 4 points in the X-Y plane. This would represent a plane, not a 3D surface. If you put a non zero value in the in one of the 3rd dimension coordinates, the call should be error free. For example:

X= [0 0 0; 1 0 0; 1 1 0; 0 1 1]

convhulln(X)

The output should be:

2 3 1

4 2 1

3 4 1

4 3 2

##### 0 Comments

### See Also

### Categories

### Community Treasure Hunt

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

Start Hunting!