Hi,
I'm not very good at matlab but I can't figure why my function isn't graphing correctly. I think it has to do with the sqrt() function but I can't tell what I'm doing wrong. I've graphed it on my TI-84 which graphs it correctly. It's a conversion of water column pressure to air velocity.
h = 0:1:25;
P = 67.35187338.*sqrt(h);
plot(P)
hold on
title ('Velocity vs. Water Column')
xlabel('Water Column in inches')
ylabel('Velocity (ft/s)')

 채택된 답변

Rik
Rik 2019년 1월 23일

2 개 추천

The only edits that are obvious to me are the unnecessary call to hold and the fact you don't provide the x-axis values to the plot function. That second one causes your plot not to start at 0, but at 1.
h = 0:1:25;
P = 67.35187338.*sqrt(h);
plot(h,P)
title ('Velocity vs. Water Column')
xlabel('Water Column in inches')
ylabel('Velocity (ft/s)')

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Just for fun에 대해 자세히 알아보기

태그

질문:

2019년 1월 23일

댓글:

2019년 1월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by