Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How can I solve this ?

1 回表示 (過去 30 日間)
Ba2508
Ba2508 2014 年 12 月 18 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I have this code to generate the J1 matrix
syms r phi
r=sym('r','real');
phi=sym('phi','real');
N=zeros(3,3+2*nlayers);
Naux1=[1,0,0,r*sin(phi),-r*cos(phi);0,1,0,0,0;0,0,1,0,0];
N(:,1:5)=Naux1
J1=int(r*N'*N,r,R1,R2);
J1=int(J1,phi,0,2*pi)
But I received this error message:
The following error occurred converting from sym to double:
Error using ==> sym.double at 29
DOUBLE cannot convert the input expression into a double array.
If the input expression contains a symbolic variable, use the VPA function instead.
What should I modify ?

回答 (1 件)

Star Strider
Star Strider 2014 年 12 月 18 日
You didn’t post ‘nlayers’, ‘R1’, or ‘R2’ so we can’t run your code. It is easy enough to integrate only ‘Naux1’ (substituting only it for ‘N=Naux1’ and using symbolic variables for ‘R1’, and ‘R2’).

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by