Trying to input multiple vectors into function
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello,
I am trying to feed 2 same length vectors into the function I have made below, I want it to return an output vector of the same length
function stagpres1 = stagpres(deltaP, flowarea)
gmpercm2 = deltaP * 0.010197; %convert delta P from Pa to g/cm^2
v2 = gmpercm2/(flowarea / 317.75); %obtain velocity^2 from equation
Velocity = sqrt(v2);
stagpres1 = (1/2) * 1 * (Velocity.^2);
end
However, when I try to run it, it returns the error "not enough input arguments."
댓글 수: 0
채택된 답변
madhan ravi
2020년 10월 23일
편집: madhan ravi
2020년 10월 23일
stagpres1 = stagpres(1:10, 1:10)
function stagpres1 = stagpres(deltaP, flowarea)
gmpercm2 = deltaP * 0.010197; %convert delta P from Pa to g/cm^2
v2 = gmpercm2 ./ (flowarea / 317.75); %obtain velocity^2 from equation
Velocity = sqrt(v2);
stagpres1 = (1/2) * 1 * (Velocity.^2);
end
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!