Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

i trung to run this, but it show to me this error :
Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
can any one help me .
the error is in line 2 .
this is the code:
fiqure()
1. plot (V_X(1,:)),((V_X(2,:)),'k')
2. hold on
3. title(('--------',int2str(n)))
4. plot ((matrixV(1,:)),((matrixV(2,:)),'--r*')
5. hold off

 채택된 답변

Remove the numbers before you commands.
Check that your parentheses are lining up the way you intend. Your first plot command has a mismatched number of opening and closing parentheses. Syntax should be plot(x,y)
plot(V_X(1,:)),((V_X(2,:)),'k')
^ ^ remove these ones
You use a lot of unnecessary parentheses. Removing these makes it easier to spot mismatches.
figure
plot(V_X(1,:),V_X(2,:),'k')
hold on
title('--------',int2str(n))
plot(matrixV(1,:),matrixV(2,:),'--r*')
hold off

추가 답변 (0개)

카테고리

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

질문:

2021년 1월 12일

댓글:

2021년 1월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by