Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
I think this is a documentation error
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
per isakson
el 6 de Abr. de 2020
Editada: per isakson
el 6 de Abr. de 2020
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:)
Respuestas (1)
Walter Roberson
el 6 de Abr. de 2020
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 comentario
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!