3D Matrix interpolate values and plot
1 view (last 30 days)
Show older comments
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
Answers (1)
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.
0 Comments
See Also
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!