3D data plotting in matlab as a cube?
조회 수: 13 (최근 30일)
이전 댓글 표시
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;
댓글 수: 0
답변 (1개)
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.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!