how can I insert text into colum?
2 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Walter Roberson
on 18 Feb 2021
Edited: Walter Roberson
on 18 Feb 2021
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
See Also
Categories
Find more on Statistics and Linear Algebra in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!