Extract column from matrix
    516 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
SuzieChan accidently destroyed her question, by inserting thank you in this part - here is what she asked:
I have a matrix A:
A =
     6     9     4
     2     3     4
     3     5     7
How do i get the 3rd column of this - what i have is:
A = [6 2 3; 9 3 5; 4 4 7]
A2 = (...)
What do i code for A2?
0 Kommentare
Antworten (1)
  Stephan
      
      
 am 20 Okt. 2019
        
      Bearbeitet: Stephan
      
      
 am 20 Okt. 2019
  
      Do this
A2 = A(:,3)
but note that you did not code the matrix as you wrote:
>> A = [6 2 3; 9 3 5; 4 4 7] 
A =
     6     2     3
     9     3     5
     4     4     7
to achieve the matrix A you posted in your question you need:
>> A = [6 9 4; 2 3 4; 3 5 7]
A =
     6     9     4
     2     3     4
     3     5     7
>> A2 = A(:,3)
A2 =
     4
     4
     7
0 Kommentare
Siehe auch
Kategorien
				Mehr zu Operators and Elementary Operations 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!

