In <ur3k37u0czni@forum.mathforum.com> ssundar78@hotmail.com (sundar) writes:
>hi my problem is this
>i know the value of an unknown funtion in 8 points on the
>circumference of the circle
>i need to know the value of the funtion in some 20 ppoints on the
>circunference of the circle+the value of function at the centre of the
>circle and its values along various lines joining the centre and
>circunference of the circle
>i am a beginner to matlab so iwould really be obliged to you if you
>can send me a detailed answer with code if possible
Here is something that will do the job.

function [zmesh,xmesh,ymesh] = interpcirc(theta,z,nr,np,method);
%
% interpcirc.m
% Useage: [zz,xx,yy] = interpcirc(theta,z,nr,np,method)
%
% Interpolation of a function defined on the circumference of a circle of
% unit radius into the interior of the circle. The function is
% interpolated onto nr equally spaced radial points (including r=0) and np equally
% spaced polar angles. Default is cubic interpolation.
% Input: theta = set of polar angles at which z(theta) is defined.
% (theta does not have to be equally spaced or monotonically increasing)
% nr = number of radial points for the interpolated function
% np = number of polar angles for the interpolated function
% method = 'linear', 'cubic', or 'nearest' interpolation method (default 'cubic')
% Output: zmesh is the interpolated function defined on a Cartesian mesh
% defined by x and y, with dimension (nr,np+1)
% x and y are Cartesian mesh points along radial arms, with dimension (nr,np+1)
%
% Author: Peter Blunden (blunden@physics.umanitoba.ca) 2000
%
% Example:
% theta=rand(1,10)*2*pi;
% z=rand(1,10);
% interpcirc(theta,z,20,60);
%
if nargin<5
method='cubic';
end
if ~ischar(method)
method='cubic';
end
[theta,ind]=unique(sort(theta)); % make sure polar angles are monotonically increasing
if theta(end)>=2*pi  theta(1)<0
error('polar angles must be in the range 0<= theta < 2*pi');
end
x=cos(theta); % find Cartesian points
y=sin(theta);
z=z(ind);
tt=[theta theta(1)+2*pi]; % wrap around to cover full angular range
zz=[z z(1)];
%ti=[0:np1]*2*pi/np+tt(1); % np interpolated angles on circumference, no wraparound angle
ti=[0:np]*2*pi/np+tt(1); % np interpolated angles on circumference, plus wraparound angle
npolar=length(ti);
xi=cos(ti);
yi=sin(ti);
zi=interp1(tt,zz,ti,method); % interpolated function values on circumference
ri=[0:nr1]/(nr1);
xmesh=zeros(nr,npolar); % generate Cartesian mesh points within circle along radial arms
ymesh=xmesh;
for i=1:nr
for j=1:npolar
xmesh(i,j)=ri(i)*cos(ti(j));
ymesh(i,j)=ri(i)*sin(ti(j));
end
end
zmesh=griddata(xi,yi,zi,xmesh,ymesh,method);
if nargout==0
mesh(xmesh,ymesh,zmesh); % plot interpolated surface
hold on;
plot3(x,y,z,'o'); % plot original data points as circles
rotate3d; % click and rotate plot to view from different perspectives
end
