Finding values within a 3D Array

58 views (last 30 days)
Tianchu Lu
Tianchu Lu on 16 Apr 2024 at 11:03
Answered: Tianchu Lu on 24 Apr 2024 at 20:16
The problem I have is that I have a 3D array with the dimension of 181x361x1931. If I was to simulate a line at any point through the 3D array, is there a way to retrieve all the data that the simulated line would penetrate through and store them within a new array.
I have seen various answers that deals with a 2D array, but haven't seen anybody answer a question regarding a 3D array. I have also seen that there are various packages on Matlab that deals with Bresenham Line Algorithm in 3D matrix, but like I said the line is imaginary thus, i don;t have much of an idea of how to go about it. I was purely wondering if there is an easier way of doing such calculations.
  4 Comments
Chunru
Chunru on 17 Apr 2024 at 7:46
If the 3D data array and line coordinates are known, the interp3 function can be used to retrieve the data.
Tianchu Lu
Tianchu Lu on 24 Apr 2024 at 20:16
So now I used griddedInterpolant function within Matlab and it worked. than you Chunru for the suggestion

Sign in to comment.

Accepted Answer

Tianchu Lu
Tianchu Lu on 24 Apr 2024 at 20:16
The use of griddedInterpolant to solve the issue.
For more information check out the matlab page.

More Answers (0)

Categories

Find more on Multidimensional Arrays in Help Center and File Exchange

Tags

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!