Single extension not everywhere?

2 次查看(过去 30 天)
FM
FM 2022-3-29
评论: FM 2022-3-29
According to the following page, MATLAB 2019a should have automatic singleton extension:
My tests show that this is not always true:
% A test array
>> x=false(3,3)
3×3 logical array
0 0 0
0 0 0
0 0 0
% Singleton extension works
>> x([1 3],2)=true
3×3 logical array
0 1 0
0 0 0
0 1 0
% Singleton extension doesn't work
>> x([1 3],2:3)=[true true]
Unable to perform assignment because the size of the left
side is 2-by-2 and the size of the right side is 1-by-2.

采纳的回答

Paul
Paul 2022-3-29
The linked blog post does not show assignment (=) included uder "Supported Operators and Functions." It still isn't:
doc bsxfun
  1 个评论
FM
FM 2022-3-29
OK, thanks. I will code around its absence. Pity, it would streamline the code.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by