How to work rdivide function
显示 更早的评论
Hi Everone,
I have a question in relation to the rdivide function.
I tried to use the rdivide function with two arrays but the program only provided a resultant array without any vauable result, not even zeros!!
Please refer to the following what expression I used initially and after to circumvent the shortage of computation one by one of array elements:
R = rdivide(abs(i_min_1(1,1)),i_max_1(1,1));
It only worked by simple but very struggle way, piece by piece as it goes:
r_1=abs(i_min_1(1,1))/i_max_1(1,1);
Please let me know what could go wrong with it.
Many thanks in advance.
Andras
1 个评论
Stephen23
2019-8-8
Andras Gergely's incorrectly accepted "Answer" moved here:
Dear Walter Robinson and John D'Errico,
Now it works but anyway I cannot comprehend why yesterday it would not work despite I refered to and checked with the inbuilt help function.
Sorry for the inappropriate postage.
Best wishes,
Andras
采纳的回答
更多回答(1 个)
Walter Roberson
2019-8-8
1 个投票
With the exception of the case where the numerator or denominator are scalars, rdivide() before R2016b requires that the numerator and the denominator are exactly the same size. As of R2016b, rdivide() instead requires that the numerator and denominator are "compatible" sizes, as-if you had done bsxfun(@rdivide, Numerator, Denominator) . So for example if the numerator were 5 x 7 and the denominator were 5 x 1, then that would be considered compatible because it the 5 x 1 denominator would get implicitly extended to 5 x 7.
The situation is different for the function mrdivide(), which does not require that the numerator and denominator are exactly the same size or are compatible sizes, and instead requires that the numerator and denominator have the same number of columns.
Note that rdivide() is the formal name of the ./ function for element-by-element division, and that mrdivide() is the formal name for the / function for solving systems of linear equations.
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!