필터 지우기
필터 지우기

Why cannot I plot my pressure to my volume?

조회 수: 1 (최근 30일)
Christian Berwanger
Christian Berwanger 2017년 11월 21일
댓글: Walter Roberson 2017년 11월 21일
Hello, I do have two tables (both 5001x1) One represents the pressure and one represents volume. Now I want to plot these. When I select both I cannot use the plots in the upper menu. When using it in the command windows
plot(pressure,volume)
gives me the error:
Too many arguments
What am I doing wrong here?
Thanks in advance

답변 (2개)

Walter Roberson
Walter Roberson 2017년 11월 21일
? You cannot pass table objects themselves to plot(); plot() is not defined on table objects.
But that would give you a different error. More likely you should check with
which -all plot
as you probably somehow have a different plot.m on your path.
  댓글 수: 1
Christian Berwanger
Christian Berwanger 2017년 11월 21일
which -all plot shows me just some matlab paths. None of these is an own function or variable.

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


Star Strider
Star Strider 2017년 11월 21일
You most likely have a variable named ‘plot’.
Run this from a script or your Command Window:
which plot -all
If the first line is:
plot is a variable.
you have found the problem. (This is called ‘overshadowing’ a function.) The solution is to rename the variable to something that does not conflict with a function name.
  댓글 수: 5
Star Strider
Star Strider 2017년 11월 21일
You will need use the table2array function to convert them to double arrays, then plot them.
Walter Roberson
Walter Roberson 2017년 11월 21일
Or use
plot( pressure{:,1}, volume{:,1} )

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

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by