If we have 2 column matrices A, B.
>>A = [10;20;30]
A =
10
20
30
>> B = [1;2;3]
B =
1
2
3
>> A+B
ans =
11
22
33
>> A*B
??? Error using ==> mtimes
Inner matrix dimensions must agree.
In order to perform "element-wise" operations, we have to use ".", so for multiplication ".*", division "./"
>> A.*B
ans =
10
40
90
>> A./B
ans =
10
10
10
Subscribe to:
Post Comments (Atom)
Python contextlib for Timing Python code
If you've ever found yourself needing to measure the execution time of specific portions of your Python code, the `contextlib` module o...
-
If you get the following error while installing FFMPEG or other packages on CentOS 7. Requires: libva.so.1(VA_API_0.33.0)(64bit) Follow...
-
Common error: fallocate: fallocate failed: Text file busy in ubuntu OS Check the allocation: free -m or sudo swapon --show Make sure ...
-
How to fix Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' Apparently, Ma...
No comments:
Post a Comment