How to plot the curve?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have:
k=2, 2.1, 2.2, 2.3, …, 4.9, 5.0
B=[0.2,0.4,0.6,0.8,1];
R=B/(1+k/2)
How to plot R like this: Thank you!
![vd.PNG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/233231/vd.png)
0 Kommentare
Akzeptierte Antwort
Adam
am 8 Aug. 2019
Bearbeitet: Adam
am 8 Aug. 2019
R = B ./ ( 1 + k'/2 );
figure; plot( R )
or
R = bsxfun( @rdivide, B, ( 1 + k'/2 ) );
for earlier versions of Matlab that don't support implicit expansion
2 Kommentare
Adam
am 9 Aug. 2019
plot( k, R )
doc plot
gives details of different ways to parameterise plots.
If you just do
plot( R )
then it just uses indices along the x axis (i,e. 1 to 31 in your case). If you give it both an x and a y then it will plot both.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Line Plots 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!