i want to make comparison between two matrices elements after creating the two matrices.
    7 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
for i = 1:3
    x{i} = rand(3,3);
end
How can you display a number  say in matrix x{1} ,i want to get the number of row 2,column 3 and how can we make a comparison between matrix x{1} element and x{2} element???
0 Commenti
Risposte (2)
  Jonas
      
 il 17 Lug 2021
        
      Modificato: Jonas
      
 il 17 Lug 2021
  
      you have access to cell entries e.g. by using x{1}(2,3); if your matrices have all the same size i would suggest saving them in an array using
x(:,:,i)= rand(3,3);
in your loop, then it is easily accessible by using conventional triple indexing. x{1}(2,3) would then be x(2,3,1)
2 Commenti
  Jonas
      
 il 18 Lug 2021
				it depends a bit on which element you want to comapre and how you want to compare them. if you want to compare the elements at posiiton x=3 and y =2 using a histogram you could call e.g. histogram(x(2,3,:))
Vedere anche
Categorie
				Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!