Symbolic Expression Error problem !

2 visualizaciones (últimos 30 días)
Amit Chakraborty
Amit Chakraborty el 22 de En. de 2022
Comentada: Amit Chakraborty el 22 de En. de 2022
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,[]);

Respuesta aceptada

KSSV
KSSV el 22 de En. de 2022
Editada: KSSV el 22 de En. de 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,[]);

Más respuestas (0)

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by