Compare matrix 16000 X 20000 with smaller matrix 16000X1
1 view (last 30 days)
Show older comments
I tried to run code to compare big matrix.but cannot get the correct answer.
A = 16,000 X 20,000 data
B = 16,000 X 1 data
i want to get value of logical at C.
I tried C = A > B but return error 'dimension not agree'
can someone tell me the correct way to code this ?
Thank you.
1 Comment
Rik
on 4 Nov 2021
Implicit expansion was added in R2016b. Since you're using R2018a, this should work, as KSSV notes below.
Accepted Answer
KSSV
on 4 Nov 2021
It should actually work.
A = rand(5) ;
B = rand(5,1) ;
C = A > B
If it is throwing error, try:
B = reshape(B,1,5);
C = A > B
More Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!