how can solve vpa function problem?

12 ビュー (過去 30 日間)
M Sameel Hanif
M Sameel Hanif 2016 年 5 月 14 日
コメント済み: Walter Roberson 2016 年 5 月 14 日
ne=input('Number of elements ');
Ke=zeros(6,6,ne);
Kg=zeros(150,150,1);
for i=1:1:ne
L1=input('please enter starting length ');
L2=input('ending length ');
A1=input('A1 ')
A2=input('A2 ')
n=input('Beam Type- 1 for Circular 2 for Square ')
n1=input('Please enter starting node ');
n2=input('Please enter ending node ');
nen=[(3*(n1))-2 (3*(n1))-1 (3*(n1)) (3*(n2))-2 (3*(n2))-1 (3*(n2))];
theta=input('angle ')
[K]=kfunc(A1,A2,n,theta,L1,L2);
Ke(:,:,i)=K(:,:,1);
for j=1:1:6
for k=1:1:6
Kg(nen(j,k),nen(j,k),1)=Ke(j,k,i);
end
end
end
display(Kg)
i get the error
The following error occurred converting from sym to double: Error using mupadmex Error in MuPAD command: DOUBLE cannot convert the input expression into a double array.
If the input expression contains a symbolic variable, use the VPA function instead.
Error in Main (line 15) Ke(:,:,i)=K(:,:,1);

採用された回答

Walter Roberson
Walter Roberson 2016 年 5 月 14 日
Ke = sym(zeros(6,6,ne));
Kg = sym(zeros(150,150,1));
  2 件のコメント
M Sameel Hanif
M Sameel Hanif 2016 年 5 月 14 日
still getting an error
Index exceeds matrix dimensions.
Error in Main (line 18) Kg(nen(j,k),nen(j,k),1)=Ke(j,k,i);
Walter Roberson
Walter Roberson 2016 年 5 月 14 日
This is difficult for us to debug without knowing what the sample inputs are.

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

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by