how to take vector and norm for indiviual column in the complex matrix

2 ビュー (過去 30 日間)
VISHALI V
VISHALI V 2018 年 1 月 30 日
コメント済み: VISHALI V 2018 年 1 月 30 日
p=inf;
for k=1:k
gk =G(:,k);
N =norm(gk,p);
vk=gk/N;
end

採用された回答

Andrei Bobrov
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 件のコメント
VISHALI V
VISHALI V 2018 年 1 月 30 日
what value can i use for p ? if i check this code in matlab it shown values of all column are equal how should i see the indiviual column value?

サインインしてコメントする。

その他の回答 (1 件)

Torsten
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.

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by