surf plot from data sets connected to each other
조회 수: 5 (최근 30일)
이전 댓글 표시
I have a data (the file "data.mat" in attachment), that has a connected ribbons „structure”. I want to make a meshgrid and then a surface plot from the data, in a "circle way" seen on the picture below. When I tried to do this, I got an error informing that I am trying to use memory resources equivalent to billions of data.
Here is the code, I did for plotting using plot3() function.
data1=flip(data);
r=data1{:,'Yposition'};
t=data1{:,'Angle'};
z=data1{:,'MagZ'};
x=(2*pi*t)/360;
%first element of the vector
p=r(length(r),1)-2;
%last element of the vector
o=r(1,1);
%the number of radii
N=((o-p)/2)+1;
%amount of data for one circumference
k=floor(length(r)/N);
%plotting loop
figure
hold on
grid on
for i=1:(N-1);
j=(((i-1)*(k))+1):((i)*(k));
plot3((i)*cos(x(j)),(i)*sin(x(j)),z(j))
end
I ask You for help, because I have spent days on solving the problem and still don't know how to do this. :(
댓글 수: 0
채택된 답변
Chunru
2022년 9월 3일
load(websave("data.mat", "https://www.mathworks.com/matlabcentral/answers/uploaded_files/1115735/data.mat"))
head(data)
data1=flip(data);
r=data1.Yposition;
t=data1.Angle;
z=data1.Zposition;
x = r.*cosd(t);
y = r.*sind(t);
DT = delaunay(x, y);
trisurf(DT,x,y,z,r, 'EdgeColor', 'none')
view(3)
댓글 수: 5
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!