Problem with plotting symsum
1 view (last 30 days)
Show older comments
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?
0 Comments
Answers (1)
Kavya Vuriti
on 12 Nov 2019
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.
0 Comments
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!