필터 지우기
필터 지우기

I do not like this

조회 수: 1 (최근 30일)
Mariano
Mariano 2018년 7월 17일
답변: Mariano 2018년 7월 27일
>> [1 2].*[1;2] ans = 1 2 2 4
I prefer the error message!
  댓글 수: 1
Rishabh Rathore
Rishabh Rathore 2018년 7월 27일
What you are getting is the matrix with all possible combinations of elements multiplied. The element wise multiplication gives that if you multiply a row and a column vectors element wise, please refer times.

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

답변 (1개)

Mariano
Mariano 2018년 7월 27일
Thanks for your answer. I know what I am getting. It is the same I got before with kron when I wanted it. For me .* had always been a reliable shortcut for times, and at some moment this changed. Now .* is a shortcut for two different things. Before, I could relay on a.*b to give an error message whenever I had make some mistake and a was row while b was column. Now, the program creates a matrix and continues, with unexpected results. I know it is me who should be more careful with the dimensions of my vectors, but anyway, at some moment somebody has changed one of the characteristic features of good old Matlab, and I preferred the other way.
Maybe https://xkcd.com/1172/ is applicable to me in this situation ;)

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!