Plot data in the surface of a sphere

2 ビュー (過去 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!
  1 件のコメント
jeewan atwal
jeewan atwal 2020 年 8 月 13 日
is A a mxn matrix?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by