필터 지우기
필터 지우기

Surf circumferences with borders

조회 수: 2 (최근 30일)
eddie
eddie 2017년 7월 17일
댓글: eddie 2017년 7월 17일
Hi all, I want to surf a set of base, where I use a circumference to represent it. So, the script I wrote is:
clear all, close all, clc;
%%Input
Data=[0.671 1.000 0.388 0.860 0.863;...
0.782 0.745 0.453 1.000 0.999;...
0.782 0.642 0.453 1.000 0.997;...
0.781 0.568 0.453 1.000 0.995;...
0.781 0.510 0.452 1.000 0.994;...
0.780 0.466 0.452 1.000 0.992;...
0.780 0.434 0.452 1.000 0.990;...
0.779 0.367 0.451 1.000 0.987;...
0.774 0.228 0.449 1.000 0.972;...
0.780 0.455 0.452 1.000 0.991];
A=Data;
for i=1:size(A,1)
B{i}=repmat(A(i,:)',1,360/size(A,1));
end
B=cell2mat(B);
B=[B;ones(1,size(B,2))];
grados=360;
gra=pi/180;
Lx=210;
[t_elip,r_elip]=meshgrid(linspace(0,grados*gra,grados),linspace(0,Lx,6));
[x_elip,y_elip]=pol2cart(t_elip,r_elip);
X=x_elip;
Y=y_elip;
Z=B;
h1=figure;
surf(X,Y,Z),view([-360 90]),colorbar,xlim([-210 210]),ylim([-210 210]);
axis off;
After I compile this, I get the following figure:
but I want to get this with borders, as this figure:
What should I do? Thanks in advance

답변 (1개)

KSSV
KSSV 2017년 7월 17일
h1 = surf(X,Y,Z) ;
set(h1,'edgecolor','k')
  댓글 수: 1
eddie
eddie 2017년 7월 17일

Thanks KSSV, but I get this figure:

As you can see I have divisions each 1 grad. What I want to do, is to have divisions each 36 grad, because the whole circumference is divided by 10 sections. I want to get a Figure as I attached before, no divided by 1 grad but by 36 grad. What should I do?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by