How to assign negative values to a variable
141 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
vetri veeran
am 7 Aug. 2014
Kommentiert: Star Strider
am 7 Aug. 2014
I am getting an error as like this.
Subscript indices must either be real positive integers or logicals.
my code is,
V = -60
am(V)=(0.01*(V+50))/(1-exp(-(V+50)/10))
but i need to pass V=-60 to am(V). how can i pass this.
Can anyone answer for this. Thanks in advance.
1 Kommentar
Yu Jiang
am 7 Aug. 2014
It would be more helpful if you could explain what objective you are trying to achieve. It seems like am(V) is a function of V and you would like to get the value of the function at V = -60. If that is the case, you may need to define the function first before passing a value into it.
Akzeptierte Antwort
Star Strider
am 7 Aug. 2014
Bearbeitet: Star Strider
am 7 Aug. 2014
V = -60
am = @(V) (0.01*(V+50))/(1-exp(-(V+50)/10));
amV = am(V)
produces:
amV =
58.1977e-003
2 Kommentare
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!