How to plug individual matrix values into a formula
1 view (last 30 days)
Show older comments
I have a 50x2 matrix and I want to plug in the individual values into a formula of D=(L*W)/(L+W) and make an output matrix with answers. each row of the matrix is a pair of L and W that should go together when plugging them into the formula.
0 Comments
Accepted Answer
Ameer Hamza
on 29 Apr 2018
Edited: Ameer Hamza
on 29 Apr 2018
out = arrayfun(@(x, y) x*y/(x+y), A(:, 1), A(:, 2))
0 Comments
More Answers (0)
See Also
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!