3D Matrix interpolate values and plot

1 view (last 30 days)
Lukas Eich
Lukas Eich on 6 Dec 2016
Answered: KSSV on 6 Dec 2016
Hey :)
I am new and not very familiar with matlab!
For my thesis I am measuring stiffness values in 30 different positions in the working space of a robot(2mx4mx4m). I would like to add those values into a 3D matrix with a grid of 10mm, interpolate the other values, give colors to the values and plot the whole 3D matrix. So in the End I have a good overview in which areas the stiffness is high/low.
Could anyone help me:
*How to set up a 3D matrix? *How to fill in my measured values in the desired position of the matrix? *Interpolate the missing values? *Give colors to the values? *Plot the 3D Matrix?
Than you very much for your help :)
  2 Comments
KSSV
KSSV on 6 Dec 2016
How you will calculate stiffness? Where is stiffness?
Lukas Eich
Lukas Eich on 6 Dec 2016
k=F/dx ? But the calculation is not that important, the stiffness will be represented by a value like 2.523

Sign in to comment.

Answers (1)

KSSV
KSSV on 6 Dec 2016
Robo = [2 4 4] ;
dx = 0.5 ; dy = 0.5 ; dz = 0.5 ;% you can pick your desired resolution (10mm in m)
x = 0:dx:Robo(1) ;
y = 0:dx:Robo(2) ;
z = 0:dx:Robo(3) ;
[X,Y,Z] = ndgrid(x,y,z) ;
%%some random data
K = rand(size(X)) ;
for i = 1:size(X,3)
surf(X(:,:,i),Y(:,:,i),Z(:,:,i),K(:,:,i)) ;
hold on
end
Read about interp2, this is used for 2D inteprolation. Also check slice.

Categories

Find more on Interpolation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!