syms n X Y
[X]=meshgrid(0:0.1:6);
[Y]=meshgrid(0:0.1:10);
F1=(8/(pi^2))*symsum((1/(n^2))*sin(n*pi/2)*cos(n*pi*Y/6)*sin(n*pi*X/6),n,1,100);
plot3(X,Y,F1)
This is the script that i have written but i get the following error codes:
Error using symengine
Array sizes must match.
Error in sym/privBinaryOp (line 1032)
Csym = mupadmex(op,args{1}.s, args{2}.s, varargin{:});
Error in .* (line 316)
X = privBinaryOp(A, B, 'symobj::zipWithImplicitExpansion', '_mult');
Error in myscript (line 5)
F1=(8/(pi^2)).*symsum((1/(n^2)).*sin(n.*pi/2).*cos(n.*pi.*Y/6).*sin(n.*pi.*X/6),n,1,100);
How could i solve this problem?

답변 (1개)

Kavya Vuriti
Kavya Vuriti 2019년 11월 12일

0 개 추천

Hi,
I noticed that the dimensions of arrays being multiplied does not match. According to the code provided, the term cos(n*pi*Y/6) yields symbolic array of dimension 101 x 101 and the term sin(n*pi*X/6) yields symbolic array of dimension 61 x 61. You can ensure that the dimensions of X and Y are compatible for multiplication. Also, you can try appending ones to make dimensions consistent if you are using element wise multiplication instead of matrix multiplication.

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

질문:

2019년 11월 7일

답변:

2019년 11월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by