Replace value with another value
Mostra commenti meno recenti
Hi,
I have a list of data in a column
There are some values which are -1
How can I replace the -1 values in the column with 0.1 mm values?
Maybe I must use the find function?
Can you help me with the code?
Thank you.
5 Commenti
Turlough Hughes
il 16 Dic 2019
How can I replace the -1 values in the column with the between 0 and 0.1 mm values?
What do you mean by this? Do you have a rule for which value you want it to become?
Sarah Yun
il 16 Dic 2019
Turlough Hughes
il 16 Dic 2019
Can you attach the original data?
Adam Danz
il 16 Dic 2019
It's unlcear how you want to repace a single value (-1) with range of values (0:0.1). If you're working with a matrix, you cannot replace a single value with multiple values. If you're working with a cell array it's possible but it's still not clear how -1 whould be replaced.
Sarah Yun
il 16 Dic 2019
Risposte (1)
Adam Danz
il 16 Dic 2019
M(M==-1) = 0.1;
2 Commenti
If you are replacing values in Table.Variable, then M should be repaced with Table.Variable.
Table.Variable(Table.Variable == -1) = 0.1;
Please accept answers that were helpful to you: https://www.mathworks.com/matlabcentral/answers/?term=asked_by_id%3A304642
Categorie
Scopri di più su Fixed-Point Operator Replacement in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!