how can I plot y=log(2,(2-a)) ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
How can I plot y = log(2,(2-a) in matlab: I have written this code but unfortunately I encounter with errors:
a = 0:0.2:1;
C_ro = plot(-(a./2).*log(2,a./2) - ((2 - a)./2).*log(2,(2 - a)./2));
plot(a, C_ro)
1 Kommentar
Akzeptierte Antwort
Azzi Abdelmalek
am 26 Aug. 2013
Bearbeitet: Azzi Abdelmalek
am 26 Aug. 2013
Maybe you want this (if log(2,b)=log(b)/log(2))
a = 0:0.2:1;
C_ro = -(a/2).*log(a/2)/log(2) - ((2 - a)/2).*log((2 - a)/2)/log(2);
plot(a, C_ro)
0 Kommentare
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Price and Analyze Financial Instruments 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!