number divided by vector
Afficher commentaires plus anciens
Hi everyone~ I divided a number by a vector and forgot to use ./ Why it didn't report error and gave me some result? What's the meaning of this calculation? Thank you!
t = (1: 0.5: 50)';
Carnot = 1-295/(500*exp(-0.02*t)+300);
Réponses (4)
yonatan gerufi
le 9 Nov 2014
Modifié(e) : yonatan gerufi
le 9 Nov 2014
This is a tricky thing.
a. the command:
10/ [10,20]'
is equal (from matlab point of view) to:
[10;0]/ [10;20]
but the results will be just the non zeros line.
b. the command:
10/ [50,20]' (first element in denominator is larger)
is equal (from matlab point of view) to:
[0;10]/ [10;20]
but the results will be just the non zeros line.
yonatan gerufi
le 9 Nov 2014
that's a good question, i believe both needs to be illegal.
how do you suggest matlab will understand the command:
1/[1,2]' ?
[1;0]/[1;2] or [1;1]/[1;2] or perhaps [0;1]/[1;2] ?
there is lack of clarity.
if the previous answer answers your question you can do "accept answer" so people will know.
good luck!
Yuji Zhang
le 9 Nov 2014
Modifié(e) : Yuji Zhang
le 9 Nov 2014
Shoaib Waqar
le 22 Jan 2020
0 votes
you can try
1./matrix
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!