How can I plot an equation

3 ビュー (過去 30 日間)
Milad Koosha
Milad Koosha 2016 年 6 月 26 日
回答済み: Image Analyst 2016 年 6 月 26 日
Hello, how can I plot the equation: PL/PO = ((1/etha)-1) versus etha? etha = 0.2:0.2:1 Thank you

回答 (2 件)

Flavio Tonellli
Flavio Tonellli 2016 年 6 月 26 日
If i got properly your question here is the code you need:
etha = 0.2:0.2:1;
plot(etha,1./etha - 1);
You have to use the ./ operation instead of the / ones because you are dividing a scalar by a vector. The ./ divide the scalar by each of the vector elements.
This is a really basic question, so i suggest you to read the plot matlab documentation and do the basic tutorial mathworks provide http://it.mathworks.com/support/learn-with-matlab-tutorials.html.
It will be useful to understand better how matlab works! Hope my answer helped you.

Image Analyst
Image Analyst 2016 年 6 月 26 日
Try this:
etha = 0.2 : 0.2 : 1;
PL_over_PO = (1 ./ etha) - 1
plot(etha, PL_over_PO, 'b*-');
title('PL_over_PO vs. etha', 'FontSize', 13, 'Interpreter', 'none');
xlabel('etha', 'FontSize', 13);
ylabel('PL_over_PO', 'FontSize', 13, 'Interpreter', 'none');
grid on;

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by