필터 지우기
필터 지우기

The expression to the left of the equals sign is not a valid target for an assignment.

조회 수: 1 (최근 30일)
function[engtq_Nm,fuelrate_kgps]=calcengtq(xx,yy,zz,engpw_w,speed)
gearratio=[3.38,1.76,1.18,0.89,0.70,0.58];
engspeeds=speed./gearratio;
engtq_Nm=(engpw_w*30)./(pi.*engspeeds);
for i=1:1:6
fuelrategm/kwh(i)= interp2(xx,yy,zz,engspeeds(i),engtq_Nm(i));
end
fuelrate_kgps=fuelrategm/kwh.*engpw_w/36e8;
end
its giving me the error in line6. please help me with this

채택된 답변

SvB
SvB 2018년 2월 28일
If I'm right, line 6 refers to this line of code:
fuelrategm/kwh(i)= interp2(xx,yy,zz,engspeeds(i),engtq_Nm(i));
You're trying to assign the result of interp2(xx,yy,zz,engspeeds(i),engtq_Nm(i)) to a variable called fuelrategm/kwh. Matlab doesn't see this as a single variable, but interprets it as fuelrategm divided by kwh. To the left of the equal sign, you should just have a single variable.
Try renaming it to fuelrategm_kwh, and you should be fine.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by