R2025b Update 4 does not support element-wise division (./) for tf objects?

The following should divide 1/(s+1) by 2, and 1/(s+2) by 3:
s = tf('s');
sys1 = [1/(s+1), 1/(s+2)];
sys2 = [2, 3];
result = sys1 ./ sys2;
Error using ./
Invalid data type. Argument must be numeric, char, or logical.
However, I get the following error message:
Error using ./
Invalid data type. Argument must be numeric, char, or logical.
Error in
result = sys1 ./ sys2;

 采纳的回答

The same is true at least as far back as R2018a. I don't think the ./ operator has ever been defined for tf

4 个评论

Wow. This is the first time that I am trying it. I will make a note. Thanks!
The ./ operator is not defined for tf objects, but you can reorder the operations a bit to take advantage of the fact that the .* operator is defined for tf objects.
s = tf('s');
sys1 = [1/(s+1), 1/(s+2)];
sys2 = [2, 3];
A = sys1.*(1./sys2)
A = From input 1 to output: 0.5 ----- s + 1 From input 2 to output: 0.3333 ------ s + 2 Continuous-time transfer function.
I'm quite surprised that operator .* works here. I don't believe that's documented. If .* is really intended for the user, then it's a bit surprising that ./ isn't supported. I'll take a wild guess that .* is intended to be used under the hood by the toolbox functions.
Also, .* doesn't have the same functionality as might be expected insofar as singleton expansion is not supported
M = [tf(1,[1,1]),tf(1,[1,2])]
M = From input 1 to output: 1 ----- s + 1 From input 2 to output: 1 ----- s + 2 Continuous-time transfer function.
try
M.*[2,3;2,3];
catch ME
ME.message
end
ans = 'Model I/O dimensions must agree.'
Note that M is a transfer function matrix, which isn't really an array of models (Model Arrays).
I suspect that a model array is what you really want because .* isn't a defined operation from a control theoretic perspective.
Thanks for your perspective. I will avoid using what's not documented.

请先登录,再进行评论。

更多回答(0 个)

类别

产品

版本

R2025b

提问:

2026-3-2,20:51

编辑:

about 5 hours 前

Community Treasure Hunt

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

Start Hunting!

Translated by