How to implement equation:
CRE=||Pu||^2
P is a matrix

 채택된 답변

Wayne King
Wayne King 2012년 2월 23일

1 개 추천

Is Pu a vector resulting from multiplying a vector by a matrix
P = randn(2,2);
u = randn(2,1);
norm(P*u,2)

댓글 수: 1

Jaromir Kabelac
Jaromir Kabelac 2020년 3월 3일
This is not true.
norm(x, 2)
is the same as
norm(x)
and calculates the 2-norm (or Euclidian norm) of x, which could be denoted as , or usually just as .
What you probably want is the square of the norm, hence
norm(x)^2

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

추가 답변 (1개)

Jonathan Sullivan
Jonathan Sullivan 2012년 2월 23일

1 개 추천

Have you tried
CRE = norm(P)^2;
help norm
doc norm

카테고리

태그

아직 태그를 입력하지 않았습니다.

질문:

2012년 2월 23일

댓글:

2020년 3월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by