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

 Accepted Answer

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

More Answers (0)

Categories

Find more on General Applications in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!