I have a problem with semilogx command
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello,
I want to have the x axis as a log scale however it doesn't want to work. This function basically plots cubic splines in order to generate a p-v diagram, however when i run the code it only gets the splines that are shaded onwards, so the first half of the graph is missing.
Any help?
Thank you

function pv_plot(V,c1,c2,c3, c4, V_input_1, V_input_2)
for i = 2:72
x = V(i-1):((V(i+1)- V(i))/100):V(i);
y = (c1(i).*((V(i+1)-x).^3))+(c2(i).*((x-V(i)).^3))+(c3(i).*(V(i+1)-x))+(c4(i).*(x-V(i)));
semilogx(x,y)
if V(i-1)>V_input_1 && V(i)<V_input_2
H = area (x,y, 'EdgeColor', 'r');
hold on;
set(H(1), 'FaceColor', 'r');
end
end
hold off
end
4 Kommentare
Walter Roberson
am 10 Dez. 2019
Copies of V,c1,c2,c3, c4, V_input_1, V_input_2 would allow us to test the code to track down the problem.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Splines 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!