replacing items in a matrix
Ältere Kommentare anzeigen
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?
Akzeptierte Antwort
Weitere Antworten (1)
Sumit Chaudhary
am 8 Apr. 2018
0 Stimmen
clc; clear all; close all;
A = 6:2:19; r = 10;
A1 = A(find(A~=r))
Kategorien
Mehr zu Special Characters finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!