Use Matrix(Matrix == x) = y; on cell aray

1 次查看(过去 30 天)
Hello, is there a way to use some sort of this cellarray{:}(cellarray{:} == 2) = [1 1 1]; for cell array of ints? Cant really find it anywhere. Don't want to use any for loops into switch statements...

采纳的回答

KL
KL 2017-10-28
you could use find,
c(find([c{:}]==2))={1};

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by