Subtracting equal elements of one array from another array of a different size
Show older comments
Howdy,
I am having an issue that I would like some help with.
I have two arrays, one is 13x9 and the other is 7x9. What I would like to do is subtract elements of the smaller array third column from the larger array third column given that the elements in the fourth column are equal to each other. I have already reduced the dimensions of the larger array to ensure all elements of the smaller arrays fourth column are present, but I'm getting array dimension mismatch errors.
Something like...
arr1(:,3) - arr2(:,3)
if arr2(:,4) == arr1(:,4)
= newarr(:,:)
Your help is much appreciated!
2 Comments
Matt J
on 22 Apr 2022
I recommend providing an example to show what you mean along with the desired output. Perhaps with fewer rows and with only 2 columns (since only columns 3-4 matter for your problem).
Jerad King
on 22 Apr 2022
Accepted Answer
More Answers (0)
Categories
Find more on Mathematics 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!