Problem using spline in MATLAB
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
I'm new to programming and I'm trying to make a code where I get a c-value after entering my v-value in the command window.
function c = consumption(v)
load roadster.mat;
x=2:200;
cc=spline(speed_kmph,consumption_Whpkm,x);
c=????
if v<2
error ('Too high');
elseif v>200
error ('Too low');
end
endI want to get a consumption from a specific speed when I write, for example, consumption(80) in the command window.
댓글 수: 0
답변 (0개)
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!