How to make 2 matrix out of 1 one matrix??
Show older comments
Hi Guys,
I have a 8760X30 matrix, which is included with the positive and negative number. Now I want to make 2 matrix of the originally matrix with the same dimension.
The difference is in one matrix should included the possitive number from the originally matrix and replace the negatives with zero, and in the other matrix should included with negative value and replace positive number with zero.
How can I do it?
Accepted Answer
More Answers (1)
Sugar Daddy
on 25 Jun 2020
Edited: madhan ravi
on 26 Jun 2020
Aneg = (A<0) .* A
Apos = (A>0) .* A
1 Comment
Sugar Daddy
on 26 Jun 2020
beauty madhan
Categories
Find more on Creating and Concatenating Matrices 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!