How do I give a value to a function and map an interval/it's path?

조회 수: 4 (최근 30일)
may95
may95 2019년 3월 23일
편집: may95 2019년 3월 23일
For a school assignment, I need to determine whether my function goes over the tip at a curve at a certain value.
So I currently have this plot:
Which is the function:
Pi_c = max(1,1+(2*Nref-1)*(3-2*Mc/Nref).*(Mc/Nref).^2);
What I want to do is to put in:
Nref = 8
Mc = 10.8
To determine whether goes past the tipping point and just manually plot it's path on the curve.
A good example is this:
So basically I want to plot lines from one x-coordinate to another on the curve (and give it any color).
I know I'm making myself look stupid by how simple it is, but I'm totally new to matlab and really don't know what to do. Can anyone help me out?
Below is my script:
clear all;
close all;
%% Compressor characteristic
for Nref = 1:10;
Mc = [-2:0.01:15];
Pi_c = max(1,1+(2*Nref-1)*(3-2*Mc/Nref).*(Mc/Nref).^2);
MsNref(Nref,:)=Mc;
PrNref(Nref,:)=Pi_c;
end
plot(MsNref',PrNref','k')
axis([-2 15 1 20])
xlabel('m_c')
ylabel('pressure ratio')
title('Simplified compressor characteristic')
hold on
pcolor(MmN,Pi_compN,max(0,P_net));
title('Mu_T= 2e-5')
axis 'square'

답변 (0개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by