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

 Réponse acceptée

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

Plus de réponses (0)

Catégories

En savoir plus sur General Applications dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by