How can I find -ve/+ve numbers in a column and then apply a different specific equation for each?

3 visualizaciones (últimos 30 días)
if a is a column of 101 numbers. then
negative number in a= (negative number - c)/d
positive number in a =(positive number-k)/m
and save these values in a new coulmn in ax (at the same orginal order in a)
any one can help me please? plzzzzzzzzzz

Respuesta aceptada

Walter Roberson
Walter Roberson el 1 de Dic. de 2018
mask = a < 0;
result(mask) = (a(mask) -c)/d;

Más respuestas (1)

Amneh Alshawabka
Amneh Alshawabka el 2 de Dic. de 2018
Thank u very much

Categorías

Más información sobre Operators and Elementary Operations en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by