i need to calculate the term {\left| {h_i^TW} \right|^2} in CVX, where h_i is a column vector with dimension N, W is a matrix with dimension N*I. T in the upperscript means transpose.
In this term, h_i is a given vector and W is a matrix variable. Is this term can be represented as
square_pos(hi.'*W)
?
I think
square_pos(norm(hi.'*W))
is what you want. Note that here is no .
after hi
Edit: Note, I inserted a missing '
which I meant to include. And the .
I misread the order of .
and '
in your original post.
Thanks. But i think the result should be square_pos(norm(hi.’ * W)).
.’ means transpose (not just .*, i think you miss the ’ in my code).
Since hi is a column vector (N*1 dimension), and W is a N*I dimensional matrix, hi should be taken transpose and then multiply with W to make the dimension right.
Thanks. Now fixed. My mistake was a combination of misreading and making a typo.
It is your contribution, bro. I have one last question, since W is a N*I dimensional matrix, how to obtain the {\left| W \right|^2}, where this norm is Frobenius-norm of a matrix?
square_pos(norm(W,'fro'))
or
square_pos(norm(W(:)))
or
W(:)'*W(:)