필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

I think this is a documentation error

조회 수: 1 (최근 30일)
Cynthia Moore
Cynthia Moore 2020년 4월 6일
마감: MATLAB Answer Bot 2021년 8월 20일
If I search the help for "array vs matrix", the 7th and 8th entries are rdivide and ldivide. I don't see a Quote button, so I'll post what I see there in a code block:
rdivide, ./ - Right array division
This MATLAB function divides each element of A by the corresponding element of B.
Documentation > MATLAB > Language Fundamentals > Operators and Elementary Operations > Arithmetic Operations
ldivide, .\ - Left array division
This MATLAB function divides each element of A by the corresponding element of B.
Documentation > MATLAB > Language Fundamentals > Operators and Elementary Operations > Arithmetic Operations
It seems to me that the secobd line under ldivide should be:
This MATLAB function divides each element of B by the corresponding element of A.
No? Shouldn't the A and B be reversed?
  댓글 수: 1
per isakson
per isakson 2020년 4월 6일
편집: per isakson 2020년 4월 6일
Yes, it looks so, but in the description of ldivide the positions of A and B are switched. "x = B.\A divides each element of A by the corresponding element of B." Seems as if the search function replaces the formula by "This function". First of April was a week ago:)

답변 (1개)

Walter Roberson
Walter Roberson 2020년 4월 6일
No, ldivide says
B.\A divides each element of A by the corresponding element of B
whereas ldivide says
A./B divides each element of A by the corresponding element of B.
Notice that the order of A and B are reversed between the two of them.
>> [3 5].\[2 4]
ans =
0.666666666666667 0.8
And we see that the 2 from A (the second operand) was indeed divided by the 3 from B (the first operand)
  댓글 수: 1
Cynthia Moore
Cynthia Moore 2020년 4월 6일
OK. The text in the search list is in agreement with the text in the separate function descriptions. Good. But, for me, the text is unneccessarily misleading. I suggest that the text in the search list should read:
rdivide, ./ - Right array division
A./B divides each element of A by the corresponding element of B.
Documentation > MATLAB > Language Fundamentals > Operators and Elementary Operations > Arithmetic Operations
ldivide, .\ - Left array division
A.\B divides each element of B by the corresponding element of A.
Documentation > MATLAB > Language Fundamentals > Operators and Elementary Operations > Arithmetic Operations
For most people, that would be enough of a description that they would not even need to read the full text. But if they did, both writeups should always have A as the first array and B as the second array (IMHO).

이 질문은 마감되었습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by