how can I insert text into colum?
1 回表示 (過去 30 日間)
古いコメントを表示
Hi I have a FIR array 33x 13 and I want to insert on the first colum the "text" of the deFIR Vector 33x1,
FIR = zeros(33,13)
Cimo = (0:12)
FIR (1,:)= Cimo
deFIR = {'Drive','20HZ','25Hz','31Hz','39Hz','50Hz','63Hz','79Hz','99Hz','125Hz','157Hz','198Hz','250Hz','315Hz','297Hz','500Hz','630Hz','794Hz','1000Hz','1260Hz','1587Hz','2000Hz','2520Hz','3175Hz','4000Hz','5040Hz','6350Hz','800Hz','10079Hz','12699Hz','16000Hz','20000Hz','Delay'}'
how can I insert one of the colums of my array with simple text as described!
0 件のコメント
回答 (1 件)
Walter Roberson
2021 年 2 月 18 日
編集済み: Walter Roberson
2021 年 2 月 18 日
You cannot. Your FIR array is numeric, and numeric arrays can never store text.
You can use a table, such as
FIR = zeros(33,13); %not really
Cimo = (0:12); %not really
deFIR = {'Drive','20HZ','25Hz','31Hz','39Hz','50Hz','63Hz','79Hz','99Hz','125Hz','157Hz','198Hz','250Hz','315Hz','297Hz','500Hz','630Hz','794Hz','1000Hz','1260Hz','1587Hz','2000Hz','2520Hz','3175Hz','4000Hz','5040Hz','6350Hz','800Hz','10079Hz','12699Hz','16000Hz','20000Hz','Delay'}';
t = cell2table(deFIR(2:end));
t = [t, num2cell(FIR(2:end,2:end))];
t.Properties.VariableNames = [deFIR{1},"V"+Cimo(2:end)];
t
参考
カテゴリ
Help Center および File Exchange で Statistics and Linear Algebra についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!