Set nan values

Why i can´t do this?
x550(:,2)(x550(:,2)<200)=nan
??? Error: ()-indexing must appear last in an index expression.
Best Regards

 Risposta accettata

Walter Roberson
Walter Roberson il 9 Set 2011

0 voti

Because MATLAB does not allow () subscripting to be chained.
x550(x550(:,2)<200,2) = nan;

Più risposte (1)

John D'Errico
John D'Errico il 9 Set 2011

0 voti

Because it is invalid MATLAB syntax. Wanting to do something does not make it possible.

Community Treasure Hunt

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

Start Hunting!

Translated by