|
"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <gqj2vl$sv5$1@fred.mathworks.com>...
> "Eric " <ericbchang@hotmail.com> wrote in message <gqipve$rln$1@fred.mathworks.com>...
> > I have a large grid of points and want to take the linspace across the diagonal (45 degree angle). How does one do this?
>
> You have not described your problem well, Eric, and we have to resort to wild guesses. Perhaps you mean something like the following. Assume your grid is m by n points. For some a and b do this:
>
> t = linspace(a,b,m+n-1);
> M = hankel(t(1:m),t(m:m+n-1));
>
> For the other diagonal direction, you would use the 'toeplitz' function.
>
> Roger Stafford
I am trying to generate a 3D array plot using the meshgrid function. I am trying to isolate this generated plot into three bands (x axis, y axis, 45 degree line). I was able to generate the x and y axes, but am having difficulties isolating a 45 degree line. This is a sample of the code for the x and y axes.
[XX1,YY1] = meshgrid(linspace(min(xx),0.048,150),linspace(-0.035,-0.036,150));
[XX2,YY2] = meshgrid(linspace(0.048,0.049,150),linspace(-0.035,max(yy),150));
for tt = 1:1:nn,
waitbar(tt/nn,h)
cc=cc+1;
zz= time_resp(:,tt);
Wf1(:,:,cc)= griddata(xx,yy,zz,XX1,YY1,'linear');
Wf2(:,:,cc)= griddata(xx,yy,zz,XX2,YY2,'linear');
pcolor(XX1,YY1,Wf1(:,:,cc));
pcolor(XX2,YY2,Wf2(:,:,cc));
caxis([0.0 0.0003]), axis off, %
C=colormap(gray); C=C(64:-1:1,:); colormap(C);
shading interp;
axis equal;
M(:,cc)=getframe;
end
The numbers 0.048,-0.035 are just an arbitrary point on the plot.
|