How to apply element wise operation in three matrices
Show older comments
I have three matrices A, B, C (10 * 600 each). I want to learn to apply an operation (A[i][j] - C[i][j])/(B[i][j] - C[i][j]) on each element and store it in another matrix D. I'm new to this stuff. Any insights would be helpful.
Answers (1)
D = (A - C) ./ (B - C);
I would recommend that you go through all the chapters. This is really basic matlab usage.
3 Comments
Kartikeya Singh Gour
on 15 Jun 2018
Guillaume
on 15 Jun 2018
So, the actual question has nothing to do at all with what was asked! "I have three matrices A, B, C. I want to learn to apply an operation ...". Turns out that you don't have C and the problem is completely unrelated to how to calculate D.
As Stephen said, your error is due to the fact that new3.mat obviously does not have a Z variable. It's not something we can do anything about. Use a mat file that does have a Z variable or use the name of a variable that is actually in new3.mat
Categories
Find more on Matrix Indexing 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!