making an array 'skip' some numbers
Mostrar comentarios más antiguos
Hi everyone,
I am trying to make an array that looks for example like this:
x= -4 -3 -2 2 3 4
So in this example I skipped the -1 the 0 and the 1. How can I make somethink like this in matlab?
Thanks in advance
Respuesta aceptada
Más respuestas (3)
per isakson
el 19 de Feb. de 2014
Try
x =( -4:1:4);
x(abs(x)<=1)=[];
1 comentario
Doubutsu
el 19 de Feb. de 2014
Doubutsu
el 19 de Feb. de 2014
0 votos
Jos (10584)
el 19 de Feb. de 2014
A = -5:0.5:-3.5
B = 3.2:0.2:3.8
C = [A B]
C = sort(C) % if A and B overlap?
help colon
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!