필터 지우기
필터 지우기

Subscripting a table using linear indexing (one subscript) or multidimensional indexing (three or more subscripts) is not supported

조회 수: 2 (최근 30일)
I recives this error:
Subscripting a table using linear indexing (one subscript) or multidimensional indexing (three or more
subscripts) is not supported. Use a row subscript and a variable subscript.
in this command:
hold on
plot(Tmean_split{(var_Tmean_split(i))}, 'dg');
hold off
I want to plot mean value on the existing boxplot.
Tmean_split is a table and var_Tmean_split is array string of the table columns.
  댓글 수: 1
Image Analyst
Image Analyst 2020년 1월 1일
I don't know what var_Tmean_split is. Is it a cell array of strings that you got from a column of the table called Tmean_split? If so, how can you plot strings? You can only plot numbers.
When you say
Tmean_split{(var_Tmean_split(i))}
the expression inside the {} must be a number saying what column you want to use. Evidently you're not giving it a single number but a cell array, a vector, or a column from a table (I'm not sure), but it's definitely not a single column number.
Can you attach your table in a .mat file with the paper clip icon and say what column you want to plot?

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

채택된 답변

Walter Roberson
Walter Roberson 2020년 1월 1일
편집: Walter Roberson 2020년 1월 1일
plot(Tmean_split{:, var_Tmean_split(i)}, 'dg');
or
plot(Tmean_split.(var_Tmean_split(i)), 'dg');
  댓글 수: 2
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2020년 1월 1일
I recieved error using
plot(Tmean_split.(var_Tmean_split(i)), 'dg');
Error:
Table variable names must be strings or character vectors.
Walter Roberson
Walter Roberson 2020년 1월 1일
If your var_Tmean_split really is an array string like you said, then your i is not scalar.
But I suspect that your var_Tmean_split is a cell array of character vectors rather than a string array. If so then in the above, where I have var_Tmean_split(i) replace that with var_Tmean_split{i}

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by