
Jan. 28, 2002
12:37 a.m.
Hi all, Who can send me a program written in Numpy (+Vpython for graphics), that reproduces the results of the following Matlab code x=linspace(0,1,25); t=linspace(0,2,50); [X,T] = meshgrid(x,t); z=exp(-abs((X-.5)*(T-1)))+sin(X.*T); subplot(3,2,1) surf(X,T,z) axis([0,1,0,2,0.4,2.1]) xlabel('x'),ylabel('t'),zlabel('z'),title('Actual surface') [u,s,v] = svd(z); for k =1:3 zz=u(:,1:k)*s(1:k,1:k)*v(:,1:k)'; subplot(3,2,k+1) surf(X,T,zz),axis([0,1,0,2,0.4,2.1]) xlabel('x'),ylabel('t'),zlabel('z') title(['Rank',num2str(k),' approximation']) Thanks in advance Nils
8451
Age (days ago)
8451
Last active (days ago)
0 comments
1 participants
participants (1)
-
Nils Wagner