Subtracting equal elements of one array from another array of a different size
古いコメントを表示
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 件のコメント
Matt J
2022 年 4 月 22 日
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
2022 年 4 月 22 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Operators and Elementary Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!