Error using tabular/plot Too many input arguments.

15 vues (au cours des 30 derniers jours)
Sarah Sisk
Sarah Sisk le 5 Déc 2017
I am trying to plot 4 lines on the same graph and i keep getting the following error message
Error using tabular/plot
Too many input arguments.
I have entered it two ways, and gotten the same response
hold on
plot(E1var1a,E1var1b)
plot(E1var1a,E1var1b)
plot(E1var2a,E1var2b)
plot(E1var3a,E1var3b)
plot(E1var4a,E1var4b)
hold off
and
plot(E1var1a,E1var1b,E1var2a,E1var2b,E1var3a,E1var3b,E1var4a,E1var4b)
  1 commentaire
aastha sahni
aastha sahni le 16 Nov 2018
Modifié(e) : aastha sahni le 16 Nov 2018
Walter Roberson Thank you for your answer. You were correct. I was using () instead of {}. Although question is asked by someone else, It helped me. So, thank you.

Connectez-vous pour commenter.

Réponses (2)

Walter Roberson
Walter Roberson le 6 Déc 2017
It is not possible to plot() a table object. If you were to happen to ask to plot() a single table object then it would tell you that there is no function named plot() for that data type, but it happens that if you try to plot() a table object and list more than one entry, the error will be caught by different code that will give you the error about too many inputs.
You need to extract data from the table object in order to plot it.
If you thought you already had extracted the data from the columns, then you probably accidentally used something like
E1var1a = YourTable(:,1);
where you should have used
E1var1a = YourTable{:,1};
or
E1var1a = YourTable.E1var1a;
  2 commentaires
Zhe Dong
Zhe Dong le 5 Jan 2022
That's very help, although it wasn't me who asked the question, but still, thanks!

Connectez-vous pour commenter.


Seyedalireza Razavi
Seyedalireza Razavi le 19 Mai 2018
Perfect, many thanks.

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by