Fraction of the Equations
1 view (last 30 days)
Show older comments
I have to write two functions and second function is based on fraction of two equations developed in the first function.
b(i,j,k)=1 and sometimes b(i,j,k)=0 which depends on my parameters in the first function. I need a calculate the ratio of the sum of b(i,j,k)=1 and sum of b(i,j,k)=0. Appreciate your comments.
2 Comments
Aditya Verma
on 25 Jun 2020
Edited: Aditya Verma
on 25 Jun 2020
What do you mean by ratio of b(i,j,k)=1 and b(i,j,k)=0? And b(i, j, k) is binary valued function?
John D'Errico
on 25 Jun 2020
So what help do you expect? You need to write two functions. That part seems easy.
You have an array that is apparently supposed to be 1 some of the time and 0 the rest. At least, some of the time. OK. We know all we need now. Except that all of this depends on some unspecified parameters, in some unspecified way.
Then you want to compute some ratio of the sum of elements equal to 1, and the sum of elements equal to 0. Since the sum of a lot of zero elements is still zero, the ratio will be 1/0 --> inf.
Or, maybe you want to kow how MANY zeros and 1s there are. Easy enough.
Seems clear as mud to me. Where exactly do you need help on this?
Seriously, if you want help, you need to explain what you are doing.
Answers (0)
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!