making an array 'skip' some numbers
    38 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
    Doubutsu
 am 19 Feb. 2014
  
    
    
    
    
    Beantwortet: Jos (10584)
      
      
 am 19 Feb. 2014
            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
0 Kommentare
Akzeptierte Antwort
  Iain
      
 am 19 Feb. 2014
         left_x = -4:-2;
 right_x = 2:4;
 x = [left_x right_x];
 You could do also something like:
 x = [-180:10:-110 -105:5:-45 -44:44 45:5:105 110:180];
Weitere Antworten (3)
  Jos (10584)
      
      
 am 19 Feb. 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
0 Kommentare
Siehe auch
Kategorien
				Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



