yes.. iam back. i have found absolute value for vectors by commanding abs.. now i could not do divide (n1.n2/|n1| |n2|)..
    3 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
yes.. iam back. i have found absolute values for vectors by commanding abs.. now i could not do divide (n1.n2/|n1| n2)..
0 Commenti
Risposte (1)
  KSSV
      
      
 il 2 Feb 2017
        abs gives you +ve value. In your case what you have to use is norm. If I am not mistaken n1 stand for norm/ magnitude of the vector. You have to follow as below:
n1 = rand(1,10) ;
n2 = rand(1,10) ;
iwant = n1*n2'/(norm(n1)*norm(n2))
5 Commenti
  Jan
      
      
 il 2 Feb 2017
				
      Modificato: Jan
      
      
 il 2 Feb 2017
  
			@Ram: It is hard to guess, what you are asking for. Explicit examples would be useful. KSSV's code cannot create an output like "(2.22, .2333, 0.322)", therefore I'm not sure, what this means. Perhaps you want:
Result = acosd((n1 * n2.') / (norm(n1) * norm(n2)))
Vedere anche
Categorie
				Scopri di più su Matrix Indexing 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!