Error using .* Matrix dimensions must agree.
이전 댓글 표시
I worked on a machine at my Uni and wrote a code. It had a very long equation, consists of plenty of single value variables, except for 2. One was 1x15,000, the other was 2x1. The code worked perfectly providing me a 2x15,000 array as predicted. Then I went home and tried the code on my machine, ran the code (without any changes) and got the: "Error using .* Matrix dimensions must agree.".
So I decided to check the problem on a much simpler calculation, so I entered:
x=[1 2];
y=[3;4];
z=x.*y
I got the same error again:
Error using .*
Matrix dimensions must agree.
Error in Test (line 3)
z=x.*y
Clearly, the result I should've gotten is this:
z =
3 6
4 8
So I suspect something is off with my MATLAB version. Maybe something in my MATLAB's preferences could be causing this to fail?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!