Plot data in the surface of a sphere

조회 수: 3 (최근 30일)
Pablo
Pablo 2016년 5월 24일
댓글: jeewan atwal 2020년 8월 13일
Hello everybody
I have a matrix of data collected when measuring in different angles theta, phi. This matrix is 100 x 100 where each line gives a different value of theta and each column a different value for phi. I want to plot this data as a density plot over the surface of a sphere. So long I know how to do this for a given function but not for my data.
My best try, (to be honest I saw this code in a document) :
res = 100;
lambda = linspace(-pi,pi,res);
theta = linspace(-pi/2,pi/2,ceil(res/2));
[L,T] = meshgrid(lambda,theta);
f=sphHarm(8,0,L,T)+sphHarm(8,7,L,T);
[X,Y,Z] = sph2cart(L,T,1);
clf;
surf(X,Y,Z,f);
colorbar; shading interp; daspect([1 1 1]); axis tight; view([70 25]);
title('3D Plot of f on the sphere')
This code does what I want but instead of represent a function f I want to plot my collection of data:
A = importdata(filename)
which contains the information about the values for phi and theta in files and columns as told.
Can someone help me to represent also this?
Many thanks in advance!

답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by