Compare matrix 16000 X 20000 with smaller matrix 16000X1
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
Rik
2021-11-4
Implicit expansion was added in R2016b. Since you're using R2018a, this should work, as KSSV notes below.
采纳的回答
KSSV
2021-11-4
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
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!