please help me with this
3 views (last 30 days)
Show older comments
我绘制的图:
beta = 0;% Pitch angle
ind2 = 1;
forlambda=0.1:0.01:11.8
lambdai(ind2) = (1./((1./(lambda-0.02.*beta)+ (0.003./(beta^3+1)))));
Cp(ind2)=0.73.*(151./lambdai(ind2)-0.58.*beta-0.002.*beta^2.14-13.2).*(exp(-18.4./lambdai(ind2)));
ind2=ind2+1;
end
tab_lambda=[0.1:0.01:11.8];
% Kopt for MPPT (maximum power point tracking)
Cp_max=0.44;
lambda_opt=7.2;
kopt = ((0.5*ro*pi*(Radius^5)*Cp_max)/(lambda_opt^3));
figure
subplot(1,3,3)
plot(tab_lambda,Cp,'linewidth',1.5)
xlabel('lambda','fontsize',14)
ylabel('Cp','fontsize',14)
![](http://www.tatmou.com/matlabcentral/answers/uploaded_files/473327/image.png)
Now, I want the graph to be like this:
![](http://www.tatmou.com/matlabcentral/answers/uploaded_files/473332/image.jpeg)
What I must change in the code to plot this new graph???
Please help me.
Answers (2)
Steven Lord
on 29 Dec 2020
This doesn't
quite
do exactly what you want but it's close.
% Define the curve
x = 0:0.25:10;
y = 50-(x-4).^2;
% Plot it
plot(x, y);
holdon
%的豌豆k
[maxY, maxYLoc] = max(y);
% Plot the dashed lines and the "x marks the spot"
xline(x(maxYLoc),'--')
yline(maxY,'--')
plot(x(maxYLoc), maxY,'x')
% Set the limits so there's room to see the horizontal dashed line
ylim([0 60])
See Also
Categories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!