Error: File: Untitled.m Line: 4 Column: 6 The expression to the left of the equals sign is not a valid target for an assignment.

조회 수: 3 (최근 30일)
hello i m med can you help me what wrong in this programme
t=[0:0.5:60];
for n = 0.1:0.001:0.999;
{
h= 100*((1-(5*(1-n)*t)/(20*(100)^(1-n)))^(1/(1-n));
plot(h,t);
};
I have this erreur after runing : Error: File: Untitled.m Line: 4 Column: 6 The expression to the left of the equals sign is not a valid target for an assignment.

답변 (1개)

Andrew Harris
Andrew Harris 2015년 10월 17일
There are a few problems with this code. First is, I don't know what the curly braces are in there for, that's probably generating your error. You also aren't ending your for loop, and you're not storing your h for each iteration, only the last one. What is the problem you are trying to solve? It's possible you could solve it without the for loop by vectorizing the function.

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by