[問題] 急! 程式不會跑已回收

看板MATLAB作者 (TeddyPooh)時間17年前 (2008/11/27 14:32), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
不知貼在此版適不適合 如果不適請版主幫刪 問題: u''=(k^2)*u(x) u(0)=0, u'(1)=0 Use finite elements to discretize the problem and to reduce it to a corresponding generalized matrix eigenvalue problem of the form Ax=入Bx. Use the matlab function [V,D]=EIG(A,B) to determine the eigenvalues and corresponding eigenvectors for N=10. Plot your results. 主程式: function [V,D]=EIGEN(A,B) lemda=sort(diag(D)); N=length(x); H=diff(x); du=diff(u)./H k=length(xi); for i=1:k j=max(find(x(1:N-1)<x(i)); if(length(j)=0) j=1 end A=diag(1./H(1:N-2)+1./H(2:N-1),0)+diag(-1./H(2:N-1))+diag(-1./H(2:N-1)); B=diag((4./3)*H(1:N-2),0); end 副程式: N=10; [V,D]=EIGEN(A,B) plot(V,D) 我知道我的副程式不太對 因為我不太清楚我該怎麼設 我的主程式也有問題 請各位大大幫忙 非常感謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 70.70.157.14

11/28 00:18, , 1F
你的寫法怎麼看起來怪怪的...
11/28 00:18, 1F
文章代碼(AID): #19BZyPMU (MATLAB)
文章代碼(AID): #19BZyPMU (MATLAB)