構造体配列のフィールドの値を置き換えたい。たとえば、次の構文ですべての 1 を 3 に置き換えたいとします。
a(1).b = 1;
a(2).b = 2;
a(3).b = 1;
a([a.b] == 1).b = 3; % This doesn't work and spits out:
% "Insufficient outputs from right hand side to satisfy comma separated
% list expansion on left hand side. Missing [] are the most likely cause."
これには簡単な構文がありますか? このような単純な操作の見苦しい for ループは避けたいと思います。