How do you create a scatter plot using select columns from app.UITable.Data?

조회 수: 14 (최근 30일)
Dc215905
Dc215905 2022년 6월 23일
댓글: Walter Roberson 2022년 6월 23일
I have a Table where the rows get added and updated. I would like to be able to create a scatter plot of the table. Any thoughts?
  댓글 수: 2
Walter Roberson
Walter Roberson 2022년 6월 23일
Should the plotting be based upon variable (column) number, or should it be based upon column name? Are the column names or number to plot always the same or is there input indicating which ones to select?
Dc215905
Dc215905 2022년 6월 23일
편집: Dc215905 2022년 6월 23일
Yes, the plotting should be based on variable (column) and the the columns are always the same. I thought I could just convert the two columns of interest to an array and simply due scatter(Column2,Column4), but I can't find a solution.
As an example, the figure below is my table and I would like to create a scatter plot using column1 (%MSO) and Column3 (MEP Amplitude):

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

답변 (1개)

Walter Roberson
Walter Roberson 2022년 6월 23일
scatter(TableName{:,2}, TableName{:,4})
  댓글 수: 3
Dc215905
Dc215905 2022년 6월 23일
This is the error I get:
Error using scatter (line 52)
Must supply X and Y data as first arguments
The problem is that each the table is made up of cells so if I see what's in:
(app.UITable.Data{:,2})
it outputs:
ans =
'90'
ans =
'90'
ans =
'90'
ans =
'120'
ans =
'130'
ans =
'150'
ans =
'150'
ans =
'150'
ans =
'150'
ans =
'150'
ans =
'150'
ans =
'150'
ans =
'150'
Walter Roberson
Walter Roberson 2022년 6월 23일
Why are you storing text for your uitable entries? Why are you not storing numeric values?

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by