Single extension not everywhere?

1 Ansicht (letzte 30 Tage)
FM
FM am 29 Mär. 2022
Kommentiert: FM am 29 Mär. 2022
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.

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Testing Frameworks finden Sie in Help Center und File Exchange

Produkte


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by