필터 지우기
필터 지우기

How do I turn data values with corresponding 3D coordinates into a 3D matrix?

조회 수: 1 (최근 30일)
zhen
zhen 2018년 1월 9일
답변: Kim Folmer Andersen 2018년 1월 11일
Currently, I have one 3x4935 matrix with xyz coordinates, and another 1x4935 matrix with force values. I want to have a 3D matrix with the force values at their corresponding xyz coordinates.
I also want to average the force values (non zero) that are at the same coordinate.
The xyz coordinates have already been rounded to the decimal that I want them using this following code.
translation = floor(trans) + (round((trans-floor(trans))/0.5)*0.5)
Thank you in advance!

답변 (1개)

Kim Folmer Andersen
Kim Folmer Andersen 2018년 1월 11일
take a look at plot3(x,y,z) for plotting the points. next decide how you want the forces applied. 4th argument to plot3 can be color (in normalized rgb), so thats one option. there is also quiver(x,y,z,u,v,w) for plotting arrows at all the points, but since you only have one value of force, what direction (u,v,w) do you want the arrow to point in?

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by