3D data plotting in matlab as a cube?

조회 수: 14 (최근 30일)
Ahmed
Ahmed 2024년 3월 7일
답변: Abhinaya Kennedy 2024년 6월 14일
I am using following code fvc = isocaps(trc,1e-4); the problem is arises with 1e-4, for example, if my data ranges 0 - 1, if I select 1e-4 as zero it will not display the part data having zero values, how to solve it?
Following is my code and data size is 139 48 176.
fvc = isocaps(trc,1e-4); % meshgrid(1:sizes) by default, not like you care about coordinates
patch(fvc,'FaceColor','interp','EdgeColor','none') %interp
colormap(jet)
colorbar;

답변 (1개)

Abhinaya Kennedy
Abhinaya Kennedy 2024년 6월 14일
"isocaps" treats the threshold (1e-4) as a strict cutoff. Values below the threshold are entirely excluded from the isosurface generation. Since your data ranges from 0 to 1, setting the threshold to 1e-4 removes all zero values from the output. You can try one of the following solutions.
1. Adjust the threshold:
Instead of using a fixed threshold, you can calculate a threshold based on a percentage of your data range. (https://www.mathworks.com/help/matlab/ref/prctile.html)
threshold = prctile(trc(:), 1); % Find the 1st percentile value
fvc = isocaps(trc, threshold);
2. Use a different isosurfacing function:
"isosurface" takes an additional argument specifying the desired isosurface value(s). You can set this value to 0 to include all data points, including zeros.

카테고리

Help CenterFile Exchange에서 Scalar Volume Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by