replacing items in a matrix
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
CLARK KENDRICK GO
le 8 Avr 2018
Réponse apportée : Walter Roberson
le 8 Avr 2018
I have a vector:
A = 6:2:19;
and
r = 10;
I want to replace the element in A which corresponds to r with nothing.
So I want my new vector A = [6, 8, 12, 14, 16, 18];
How do I do that?
0 commentaires
Réponse acceptée
Walter Roberson
le 8 Avr 2018
A(A==r) = [];
If r is a vector or array then
A(ismember(A,r)) = [];
0 commentaires
Plus de réponses (1)
Sumit Chaudhary
le 8 Avr 2018
clc; clear all; close all;
A = 6:2:19; r = 10;
A1 = A(find(A~=r))
0 commentaires
Voir également
Catégories
En savoir plus sur Graphics Object Properties dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!