how to take vector and norm for indiviual column in the complex matrix
    조회 수: 4 (최근 30일)
  
       이전 댓글 표시
    
p=inf;
for k=1:k
gk =G(:,k);
N =norm(gk,p);
vk=gk/N;
end
댓글 수: 0
채택된 답변
  Andrei Bobrov
      
      
 2018년 1월 30일
        
      편집: Andrei Bobrov
      
      
 2018년 1월 30일
  
      vk = G;
for k=1:size(vk,2)
   vk(:,k) =G(:,k)/norm(G(:,k),inf);
end
추가 답변 (1개)
  Torsten
      
      
 2018년 1월 30일
        
      편집: Torsten
      
      
 2018년 1월 30일
  
      1) "for k=1:k" won't work ; you will have to use another variable name for the upper bound of the Loop.
2) You permanently overwrite the vectors vk in the loop. Adding the line Gnorm(:,k)=vk should work.
p=Inf;
for k=1:size(G,2)
  gk =G(:,k);
  N =norm(gk,p); 
  vk=gk/N; 
  Gnorm(:,k)=vk;
end
Best wishes
Torsten.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


