How do I assign a Variable name to a table Variable?

I want to assign a name that is a variable to a table variable.
tablename = strcat(a,'_',b,'_',c,'_Amplitudeanalysistable')
% the output for this is : 'scan1396_defect16_54deg_Amplitudeanalysistable'
% a , b and c are input variables
tablename = table(index2,Amplitudepoollocus,Amplitudepool)
% i want to use the name 'scan1396_defect16_54deg_Amplitudeanalysistable' for this table variable.
% i also tried strcat(a,'_',b,'_',c,'_Amplitudeanalysistable') = table(index2,Amplitudepoollocus,Amplitudepool)
which gives
" You cannot subscript a table using linear
indexing (one subscript) or
multidimensional indexing (three or more
subscripts). Use a row subscript and a
variable subscript."

1 个评论

In addition to what Walter points out, I'm guess the error you've shown is cause by either 1) a variable in your workspace named "table", which is a bad idea, or 2) you haven't shown us the real code you executed

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Tables 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by