필터 지우기
필터 지우기

CVX - mtimes error - multiplication of vectors

조회 수: 2 (최근 30일)
Sree Prasanna Rajagopal
Sree Prasanna Rajagopal 2013년 6월 12일
Is there a way to do vector multiplication in the cvx ( http://cvxr.com/cvx/) environment? Because there is a problem I need to solve and I'm not sure how a constraint can be framed without something so simple as a vector multiplication. I was using fmincon and there was no problem but now, when I use the same function, I get errors.
The operation I get error on is like this:
C = A*B
where A = column vector and B = row vector

답변 (1개)

Roger Stafford
Roger Stafford 2013년 6월 12일
If A is a column vector and B a row vector, you should get no error message on the operation
C = A*B
The result should be an array which has as many rows as elements in A and as many columns as elements in B. It contains every possible product between elements of A and B.
You WILL get an error if A is a row vector and B a column vector if they have different numbers of elements.
  댓글 수: 2
Sree Prasanna Rajagopal
Sree Prasanna Rajagopal 2013년 6월 12일
Yeah, I'm not talking about general matrix multiplication rules here. My question is specific to the CVX environment.
Roger Stafford
Roger Stafford 2013년 6월 12일
You should not assume that people who answer questions here understand the workings of CVX. Certainly I don't. Please phrase your question in terms such that we can easily understand what you are asking without having to comprehend all the details of CVX.

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

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by