Fraction of the Equations
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
Aditya Verma
2020-6-25
编辑:Aditya Verma
2020-6-25
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
2020-6-25
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.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!