error using find: Matrix dimensions must agree

comms is a matrix and nb is a vector with different dimensions.
[nb_comms,~]=find(comms==nb);
error: Error using == Matrix dimensions must agree.

Answers (1)

I am not certain what you are doing. See if the intersect or related functions do what you want.
Example:
comms = randi(99, 1, 50);
nb = randi(50, 1, 10);
[nb_comms, idx_comms, idx_nb] = intersect(comms,nb);

1 Comment

Siamak comments to Star Strider:
Thank you so much for your helpful answer

Sign in to comment.

Categories

Find more on RF Toolbox in Help Center and File Exchange

Tags

Asked:

on 22 Apr 2016

Commented:

on 22 May 2017

Community Treasure Hunt

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

Start Hunting!