Plot two columns from a table error

조회 수: 2 (최근 30일)
Niko
Niko 2023년 5월 19일
댓글: Image Analyst 2023년 6월 1일
plot( t.x, t.y );
Output:
Error using plot
Too many input arguments.
Where t.x and t.y are 50000x1 double

답변 (1개)

Image Analyst
Image Analyst 2023년 5월 19일
What do these next 2 lines show in your command window?
whos t
which -all plot
built-in (/MATLAB/toolbox/matlab/graph2d/plot) /MATLAB/toolbox/matlab/graphics/math/@digraph/plot.m % digraph method /MATLAB/toolbox/matlab/graphics/math/@graph/plot.m % graph method /MATLAB/toolbox/matlab/timeseries/@timeseries/plot.m % timeseries method /MATLAB/toolbox/matlab/graphics/math/@polyshape/plot.m % polyshape method /MATLAB/toolbox/matlab/graphics/math/@alphaShape/plot.m % alphaShape method /MATLAB/toolbox/matlab/bigdata/@tall/plot.m % tall method /MATLAB/toolbox/bioinfo/bioinfo/@phytree/plot.m % phytree method /MATLAB/toolbox/bioinfo/microarray/@HeatMap/plot.m % HeatMap method /MATLAB/toolbox/bioinfo/microarray/@clustergram/plot.m % clustergram method /MATLAB/toolbox/curvefit/curvefit/@cfit/plot.m % cfit method /MATLAB/toolbox/curvefit/curvefit/@sfit/plot.m % sfit method /MATLAB/toolbox/econ/econ/@conjugateblm/plot.m % conjugateblm method /MATLAB/toolbox/econ/econ/@diffuseblm/plot.m % diffuseblm method /MATLAB/toolbox/econ/econ/@mixconjugateblm/plot.m % mixconjugateblm method /MATLAB/toolbox/econ/econ/@lassoblm/plot.m % lassoblm method /MATLAB/toolbox/econ/econ/@mixsemiconjugateblm/plot.m % mixsemiconjugateblm method /MATLAB/toolbox/econ/econ/@empiricalblm/plot.m % empiricalblm method /MATLAB/toolbox/econ/econ/@blm/plot.m % blm method /MATLAB/toolbox/econ/econ/@customblm/plot.m % customblm method /MATLAB/toolbox/econ/econ/@semiconjugateblm/plot.m % semiconjugateblm method /MATLAB/toolbox/ident/ident/@iddata/plot.m % iddata method /MATLAB/toolbox/ident/nlident/@idnlarx/plot.m % idnlarx method /MATLAB/toolbox/ident/nlident/@idnlhw/plot.m % idnlhw method /MATLAB/toolbox/mpc/mpc/@mpc/plot.m % mpc method /MATLAB/toolbox/robust/rctobsolete/robust/@frd/plot.m % frd method /MATLAB/toolbox/robust/robust/@umargin/plot.m % umargin method /MATLAB/toolbox/shared/channel/rfprop/@propagationData/plot.m % propagationData method /MATLAB/toolbox/shared/drivingscenario/@drivingScenario/plot.m % drivingScenario method /MATLAB/toolbox/signal/signal/@dspdata/plot.m % dspdata method /MATLAB/toolbox/stats/bayesoptim/@BayesianOptimization/plot.m % BayesianOptimization method /MATLAB/toolbox/stats/classreg/@LinearModel/plot.m % LinearModel method /MATLAB/toolbox/wavelet/wavelet/@dtree/plot.m % dtree method /MATLAB/toolbox/wavelet/wavelet/@wdectree/plot.m % wdectree method /MATLAB/toolbox/wavelet/wavelet/@ntree/plot.m % ntree method
x = [1:5000]';
y = sin(2 * pi * x / 1000);
t = table(x, y)
t = 5000×2 table
x y __ _________ 1 0.0062831 2 0.012566 3 0.018848 4 0.02513 5 0.031411 6 0.03769 7 0.043968 8 0.050244 9 0.056519 10 0.062791 11 0.06906 12 0.075327 13 0.081591 14 0.087851 15 0.094108 16 0.10036
plot(t.x, t.y); % See No error if you do it right.
  댓글 수: 4
Niko
Niko 2023년 6월 1일
interesting...
So this is what I get from which
built-in (C:\Program Files\MATLAB\R2022b\toolbox\matlab\graph2d\plot)
C:\Program Files\MATLAB\R2022b\toolbox\matlab\bigdata\@tall\plot.m % tall method
C:\Program Files\MATLAB\R2022b\toolbox\matlab\graphics\math\@alphaShape\plot.m % alphaShape method
C:\Program Files\MATLAB\R2022b\toolbox\matlab\graphics\math\@digraph\plot.m % digraph method
C:\Program Files\MATLAB\R2022b\toolbox\matlab\graphics\math\@graph\plot.m % graph method
C:\Program Files\MATLAB\R2022b\toolbox\matlab\graphics\math\@polyshape\plot.m % polyshape method
C:\Program Files\MATLAB\R2022b\toolbox\matlab\timeseries\@timeseries\plot.m % timeseries method
C:\Program Files\MATLAB\R2022b\examples\wavelet\data\@edwttree\plot.m % edwttree method
C:\Program Files\MATLAB\R2022b\examples\wavelet\data\@rwvtree\plot.m % rwvtree method
C:\Program Files\MATLAB\R2022b\examples\wavelet\data\@wvtree\plot.m % wvtree method
C:\Program Files\MATLAB\R2022b\toolbox\bioinfo\bioinfo\@phytree\plot.m % phytree method
C:\Program Files\MATLAB\R2022b\toolbox\bioinfo\microarray\@clustergram\plot.m % clustergram method
C:\Program Files\MATLAB\R2022b\toolbox\bioinfo\microarray\@HeatMap\plot.m % HeatMap method
C:\Program Files\MATLAB\R2022b\toolbox\coder\half\@half\plot.p % half method
C:\Program Files\MATLAB\R2022b\toolbox\curvefit\curvefit\@cfit\plot.m % cfit method
C:\Program Files\MATLAB\R2022b\toolbox\curvefit\curvefit\@sfit\plot.m % sfit method
C:\Program Files\MATLAB\R2022b\toolbox\ident\ident\@iddata\plot.m % iddata method
C:\Program Files\MATLAB\R2022b\toolbox\ident\nlident\@idnlarx\plot.m % idnlarx method
C:\Program Files\MATLAB\R2022b\toolbox\ident\nlident\@idnlhw\plot.m % idnlhw method
C:\Program Files\MATLAB\R2022b\toolbox\robust\rctobsolete\robust\@frd\plot.m % frd method
C:\Program Files\MATLAB\R2022b\toolbox\robust\robust\@umargin\plot.m % umargin method
C:\Program Files\MATLAB\R2022b\toolbox\shared\channel\rfprop\@propagationData\plot.m % propagationData method
C:\Program Files\MATLAB\R2022b\toolbox\signal\signal\@dspdata\plot.m % dspdata method
C:\Program Files\MATLAB\R2022b\toolbox\stats\classreg\@LinearModel\plot.m % LinearModel method
C:\Program Files\MATLAB\R2022b\toolbox\wavelet\wavelet\@dtree\plot.m % dtree method
C:\Program Files\MATLAB\R2022b\toolbox\wavelet\wavelet\@ntree\plot.m % ntree method
C:\Program Files\MATLAB\R2022b\toolbox\wavelet\wavelet\@wdectree\plot.m
Image Analyst
Image Analyst 2023년 6월 1일
Yeah, that all looks fine. They're just overloaded versions of plot. But you don't want to see something like
c:\users\NIKO\Documents\matlab\work\plot.m
which is some version of your own creation.

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

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by