Switch-case error message by matlab

Hey guys, I got this "problem" I made a switch-case thingy and it is working, but matlab shows me these red bars at the right side and tells me "the expression cannot be assigned to multiple values", marking my [P2,FTLE] = FTLE[...] epression.
switch direction
case 'forward'
[P2,FTLE] = FTLE_forward(Variables);
case 'backward'
[P2,FTLE] = FTLE_backward(Variables);
case 'both'
master = 1; %for plot
direction = Possible_direction{1};
[P2,FTLE] = FTLE_forward(Variables);
P2_forward = P2;
FTLE_forward = FTLE;
direction = Possible_direction{2};
[P2,FTLE] = FTLE_backward(Variables);
P2_backward = P2;
FTLE_backward = FTLE;
otherwise
disp('unstruction unclear');
return;
end
So what do I have to do or do I even have to change anything at all ? Seems like matlab is not happy that I use these two function in the "both" case again, because if I comment it out, matlab seems to be fine with it.

댓글 수: 4

Stephen23
Stephen23 2017년 5월 22일
What are FTLE_forward and FTLE_backward: functions or variables?
H ZETT M
H ZETT M 2017년 5월 22일
They are functions.
Stephen23
Stephen23 2017년 5월 22일
@H ZETT M: okay. Please show us the complete error message. This means all of the red text.
H ZETT M
H ZETT M 2017년 5월 22일
I already found the mistake. in "both" FTLE_forward gets used as a function first, but soon after I create a variable with the same name.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

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

제품

태그

질문:

2017년 5월 22일

댓글:

2017년 5월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by