Symbolic Expression Error problem !

2 views (last 30 days)
I have two codes. one is with the numeric value and another code with the sysmbolic value. But both of them are same logic.
Any kind of suggestion or solution would be helpful for me. Thanks in Advance!
%% Numeric Value Code
FFF = rand(8,2);
TTT = rand(2,2);
FFF = reshape(FFF, 4, 2, []);
TTT = reshape(TTT, 1, 2, []);
Result_FRD = reshape(FFF .* TTT, 4*2,[]) ;
%% Symbolic Expression Code
FFF = sym('FF',[8 2]) ;
TTT = sym('TT',[2 2]) ;
TTT = reshape(TTT, 1, 2, []);
FFF = reshape(FFF, 4, 2, []);
RRR = reshape(FFF .* TTT, 4*2,[]);
ERROR I am Having ::::::::
Error using symengine
Array sizes must match.
Error in sym/privBinaryOp (line 1034)
Csym = mupadmex(op,args{1}.s, args{2}.s, varargin{:});
Error in .* (line 323)
X = privBinaryOp(A, B, 'symobj::zipWithImplicitExpansion', '_mult');
Error in FD_Test (line 14)
RRR = reshape(FFF .* TTT, 4*2,[]);

Accepted Answer

KSSV
KSSV on 22 Jan 2022
Edited: KSSV on 22 Jan 2022
Proceed with loop.
%% Numeric Value Code
FFF = rand(8,2);
TTT = rand(2,2);
FFF = reshape(FFF, 4, 2, []);
TTT = reshape(TTT, 1, 2, []);
Result_FRD = reshape(FFF .* TTT, 4*2,[]) ;
%% Symbolic Expression Code
FFF = sym('FF',[8 2]) ;
TTT = sym('TT',[2 2]) ;
TTT = reshape(TTT, 1, 2, []);
FFF = reshape(FFF, 4, 2, []);
%
RRR = FFF ;
for i = 1:2
RRR(:,:,i) = FFF(:,:,i).*TTT(:,:,i) ;
end
RRR = reshape(RRR, 4*2,[]);

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!