v=[1 2 3;4 5 6;7 8 9]
l2=zeros(3,1)
for i=1:3
l2=norm(v((i),:),2)
end
i want to store store l2 values in an array.

댓글 수: 1

kitty varghese
kitty varghese 2017년 8월 8일
편집: kitty varghese 2017년 8월 8일
here is the code u may try
v=[1 2 3;4 5 6;7 8 9]
l2=zeros(3,1)
for i=1:3 l2(i,:)=norm(v((i),:),2) end

댓글을 달려면 로그인하십시오.

 채택된 답변

KSSV
KSSV 2017년 8월 8일

0 개 추천

v=[1 2 3;4 5 6;7 8 9] ;
l2=zeros(3,1) ;
for i=1:3
l2(i) = norm(v((i),:),2) ;
end
Read about MATLAB matrix indexing.....

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

질문:

2017년 8월 8일

편집:

2017년 8월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by