# calculate wrong or "/" work different

1 vue (au cours des 30 derniers jours)
pipor le 3 Sep 2023
Commenté : Dyuman Joshi le 5 Sep 2023
b=156260
c=165000
c\b
>> untitled3
b =
156260
c =
165000
ans =
0.9470 !?!?!
165000/156260=1.056 i use calc window
##### 0 commentairesAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens

Connectez-vous pour commenter.

### Réponse acceptée

Paul le 3 Sep 2023
Modifié(e) : Paul le 3 Sep 2023
Hi pipor
The ldivide, .\ and mldivide, \, which is what you're actually using here, for the scalar case are mathematically (though not necessarily numerically) the same as
%c\b = (1/c)*b
b=156260;
c=165000;
c\b
ans = 0.9470
(1/c)*b
ans = 0.9470
What you did in the calc window used mrdivide, / which for scalar is the same as rdivide, ./, and does regular old division
c/b
ans = 1.0559
##### 3 commentairesAfficher 2 commentaires plus anciensMasquer 2 commentaires plus anciens
Dyuman Joshi le 5 Sep 2023
"I don't understand why matlab has to make these complications ..."
These are not complications. Those are different functions with different functionalities.
MATLAB is based on Matrices and both the functionalities have their own significance and use in linear algebra.
Nowhere in Mathematics is forward slash used for division of two numeric values. You, @pipor, yourself used the backward slash to get the result -
%Backward slash
% v
165000/156260=1.056 i use calc window
But why forward slash here?
%v
c\b

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Signal Operations dans Help Center et File Exchange

### Community Treasure Hunt

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

Start Hunting!