i had two values x and y and their sum is equal to z. i need matlab code for that
1 回表示 (過去 30 日間)
古いコメントを表示
i had two values x and y and their sum is equal to z. Now i need to write matlab code for that. So please send me as soon as possible.
0 件のコメント
回答 (1 件)
Image Analyst
2014 年 10 月 11 日
There is no code to do that. x and y sum to (x+y) and that may or may not equal z. For example, if x=3 and y=9, there's no way that their sum will equal 42 instead of 12. 12 is what the sum is . If you need to clarify, like you want a new x and y that have the same relative ratio and those sum to z (as shown below), then please do clarify.
xNew = z * xOld / (xOld+yOld);
yNew = z * yOld / (xOld+yOld);
2 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!