Symbolic Expression Error problem !

1 次查看(过去 30 天)
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,[]);

采纳的回答

KSSV
KSSV 2022-1-22
编辑:KSSV 2022-1-22
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,[]);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by