現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
unpack cell array of letters to be plugged into individual-cell rows, in a vector
5 ビュー (過去 30 日間)
古いコメントを表示
Dear Matlab,
I have a cell array of letters in each cell (they are channel labels), attached herein.
Eventually, I want to 'unpack' the string contents of each cell, and list them, in their own separate cell, splayed out as a row vector at the end of this below for-loop
(because in the end my GOAL is the have a list of channel locations on each experiment subject, with each subject on its own row)
(can even ignore the 1st 4 columns in the 'infon2' variable, and just make C as its own row, if easier). Hopefully this makes sense. Pls lmk if not.
as always, thanks much in advance for your help!!
Joanne
for k = 1:length(setl) % 'setl' is a list of file names for each subject
setlist = setl(k); %MAYBE CANT INDEX INTO A STRUCT
srate = num2str(200);
length1 = 2000;
ref = 3;
% initialize matrices on 1st subject
if k == 1
infon2 = strings([ length({setl.name}) 5 ]);
end % end initialization loop
infon2(k,:,:,:,:) = {num2str(k); srate; length1; ref; [c{:}]}';
close all;
end
4 件のコメント
Matt J
2023 年 6 月 21 日
Hopefully this makes sense. Pls lmk if not.
No, not to me. An example would be advisable.
採用された回答
Matt J
2023 年 6 月 22 日
load infon2
c=infon2(:,end);
L=max(cellfun(@numel,c));
for i=1:numel(c)
c{i}(end+1:L)="";
end
c=num2cell(vertcat(c{:}));
infon2=[infon2(:,1:end-1) , c]
infon2 = 240×47 cell array
Columns 1 through 13
{'1' } {'200' } {'150.995'} {'common'} {["Fp1-Ref"]} {["Fp2-Ref"]} {["F3-Ref"]} {["F4-Ref"]} {["C3-Ref"]} {["C4-Ref"]} {["P3-Ref"]} {["P4-Ref"]} {["O1-Ref"]}
{'2' } {'200' } {'96.995' } {'common'} {["Fp1-Ref"]} {["Fp2-Ref"]} {["F3-Ref"]} {["F4-Ref"]} {["C3-Ref"]} {["C4-Ref"]} {["P3-Ref"]} {["P4-Ref"]} {["O1-Ref"]}
{'3' } {'200' } {'219.995'} {'common'} {["Fp1-Ref"]} {["Fp2-Ref"]} {["F3-Ref"]} {["F4-Ref"]} {["C3-Ref"]} {["C4-Ref"]} {["P3-Ref"]} {["P4-Ref"]} {["O1-Ref"]}
{'4' } {'200' } {'68.995' } {'common'} {["Fp1-Ref"]} {["Fp2-Ref"]} {["F3-Ref"]} {["F4-Ref"]} {["C3-Ref"]} {["C4-Ref"]} {["P3-Ref"]} {["P4-Ref"]} {["O1-Ref"]}
{'5' } {'200' } {'289.995'} {'common'} {["Fp1-Ref"]} {["Fp2-Ref"]} {["F3-Ref"]} {["F4-Ref"]} {["C3-Ref"]} {["C4-Ref"]} {["P3-Ref"]} {["P4-Ref"]} {["O1-Ref"]}
{'6' } {'200' } {'824.995'} {'common'} {["Fp1-Ref"]} {["Fp2-Ref"]} {["F3-Ref"]} {["F4-Ref"]} {["C3-Ref"]} {["C4-Ref"]} {["P3-Ref"]} {["P4-Ref"]} {["O1-Ref"]}
{'7' } {'200' } {'218.995'} {'common'} {["Fp1-Ref"]} {["Fp2-Ref"]} {["F3-Ref"]} {["F4-Ref"]} {["C3-Ref"]} {["C4-Ref"]} {["P3-Ref"]} {["P4-Ref"]} {["O1-Ref"]}
{'8' } {'200' } {'217.995'} {'common'} {["Fp1-Ref"]} {["Fp2-Ref"]} {["F3-Ref"]} {["F4-Ref"]} {["C3-Ref"]} {["C4-Ref"]} {["P3-Ref"]} {["P4-Ref"]} {["O1-Ref"]}
{'9' } {'200' } {'58.995' } {'common'} {["Fp1-Ref"]} {["Fp2-Ref"]} {["F3-Ref"]} {["F4-Ref"]} {["C3-Ref"]} {["C4-Ref"]} {["P3-Ref"]} {["P4-Ref"]} {["O1-Ref"]}
{'10'} {'200' } {'57.995' } {'common'} {["Fp1-Ref"]} {["Fp2-Ref"]} {["F3-Ref"]} {["F4-Ref"]} {["C3-Ref"]} {["C4-Ref"]} {["P3-Ref"]} {["P4-Ref"]} {["O1-Ref"]}
{'11'} {'200' } {'43.995' } {'common'} {["Fp1-Ref"]} {["Fp2-Ref"]} {["F3-Ref"]} {["F4-Ref"]} {["C3-Ref"]} {["C4-Ref"]} {["P3-Ref"]} {["P4-Ref"]} {["O1-Ref"]}
{'12'} {'1000'} {'41.579' } {'common'} {["Fp1-Ref"]} {["Fp2-Ref"]} {["F3-Ref"]} {["F4-Ref"]} {["C3-Ref"]} {["C4-Ref"]} {["P3-Ref"]} {["P4-Ref"]} {["O1-Ref"]}
{'13'} {'200' } {'248.995'} {'common'} {["Fp1-Ref"]} {["Fp2-Ref"]} {["F3-Ref"]} {["F4-Ref"]} {["C3-Ref"]} {["C4-Ref"]} {["P3-Ref"]} {["P4-Ref"]} {["O1-Ref"]}
{'14'} {'200' } {'319.995'} {'common'} {["Fp1-Ref"]} {["Fp2-Ref"]} {["F3-Ref"]} {["F4-Ref"]} {["C3-Ref"]} {["C4-Ref"]} {["P3-Ref"]} {["P4-Ref"]} {["O1-Ref"]}
{'15'} {'200' } {'109.995'} {'common'} {["Fp1-Ref"]} {["Fp2-Ref"]} {["F3-Ref"]} {["F4-Ref"]} {["C3-Ref"]} {["C4-Ref"]} {["P3-Ref"]} {["P4-Ref"]} {["O1-Ref"]}
{'16'} {'200' } {'89.995' } {'common'} {["Fp1-Ref"]} {["Fp2-Ref"]} {["F3-Ref"]} {["F4-Ref"]} {["C3-Ref"]} {["C4-Ref"]} {["P3-Ref"]} {["P4-Ref"]} {["O1-Ref"]}
Columns 14 through 25
{["O2-Ref"]} {["F7-Ref"]} {["F8-Ref"]} {["T3-Ref"]} {["T4-Ref"]} {["T5-Ref"]} {["T6-Ref"]} {["Fz-Ref"]} {["Cz-Ref"]} {["Pz-Ref"]} {["POL E"]} {["POL PG1"]}
{["O2-Ref"]} {["F7-Ref"]} {["F8-Ref"]} {["T3-Ref"]} {["T4-Ref"]} {["T5-Ref"]} {["T6-Ref"]} {["Fz-Ref"]} {["Cz-Ref"]} {["Pz-Ref"]} {["POL E"]} {["POL PG1"]}
{["O2-Ref"]} {["F7-Ref"]} {["F8-Ref"]} {["T3-Ref"]} {["T4-Ref"]} {["T5-Ref"]} {["T6-Ref"]} {["Fz-Ref"]} {["Cz-Ref"]} {["Pz-Ref"]} {["POL E"]} {["POL PG1"]}
{["O2-Ref"]} {["F7-Ref"]} {["F8-Ref"]} {["T3-Ref"]} {["T4-Ref"]} {["T5-Ref"]} {["T6-Ref"]} {["Fz-Ref"]} {["Cz-Ref"]} {["Pz-Ref"]} {["POL E"]} {["POL PG1"]}
{["O2-Ref"]} {["F7-Ref"]} {["F8-Ref"]} {["T3-Ref"]} {["T4-Ref"]} {["T5-Ref"]} {["T6-Ref"]} {["Fz-Ref"]} {["Cz-Ref"]} {["Pz-Ref"]} {["POL E"]} {["POL PG1"]}
{["O2-Ref"]} {["F7-Ref"]} {["F8-Ref"]} {["T3-Ref"]} {["T4-Ref"]} {["T5-Ref"]} {["T6-Ref"]} {["Fz-Ref"]} {["Cz-Ref"]} {["Pz-Ref"]} {["POL E"]} {["POL PG1"]}
{["O2-Ref"]} {["F7-Ref"]} {["F8-Ref"]} {["T3-Ref"]} {["T4-Ref"]} {["T5-Ref"]} {["T6-Ref"]} {["Fz-Ref"]} {["Cz-Ref"]} {["Pz-Ref"]} {["POL E"]} {["POL PG1"]}
{["O2-Ref"]} {["F7-Ref"]} {["F8-Ref"]} {["T3-Ref"]} {["T4-Ref"]} {["T5-Ref"]} {["T6-Ref"]} {["Fz-Ref"]} {["Cz-Ref"]} {["Pz-Ref"]} {["POL E"]} {["POL PG1"]}
{["O2-Ref"]} {["F7-Ref"]} {["F8-Ref"]} {["T3-Ref"]} {["T4-Ref"]} {["T5-Ref"]} {["T6-Ref"]} {["Fz-Ref"]} {["Cz-Ref"]} {["Pz-Ref"]} {["POL E"]} {["POL PG1"]}
{["O2-Ref"]} {["F7-Ref"]} {["F8-Ref"]} {["T3-Ref"]} {["T4-Ref"]} {["T5-Ref"]} {["T6-Ref"]} {["Fz-Ref"]} {["Cz-Ref"]} {["Pz-Ref"]} {["POL E"]} {["POL PG1"]}
{["O2-Ref"]} {["F7-Ref"]} {["F8-Ref"]} {["T3-Ref"]} {["T4-Ref"]} {["T5-Ref"]} {["T6-Ref"]} {["Fz-Ref"]} {["Cz-Ref"]} {["Pz-Ref"]} {["POL E"]} {["POL PG1"]}
{["O2-Ref"]} {["F7-Ref"]} {["F8-Ref"]} {["T3-Ref"]} {["T4-Ref"]} {["T5-Ref"]} {["T6-Ref"]} {["Fz-Ref"]} {["Cz-Ref"]} {["Pz-Ref"]} {["POL E"]} {["POL PG1"]}
{["O2-Ref"]} {["F7-Ref"]} {["F8-Ref"]} {["T3-Ref"]} {["T4-Ref"]} {["T5-Ref"]} {["T6-Ref"]} {["Fz-Ref"]} {["Cz-Ref"]} {["Pz-Ref"]} {["POL E"]} {["POL PG1"]}
{["O2-Ref"]} {["F7-Ref"]} {["F8-Ref"]} {["T3-Ref"]} {["T4-Ref"]} {["T5-Ref"]} {["T6-Ref"]} {["Fz-Ref"]} {["Cz-Ref"]} {["Pz-Ref"]} {["POL E"]} {["POL PG1"]}
{["O2-Ref"]} {["F7-Ref"]} {["F8-Ref"]} {["T3-Ref"]} {["T4-Ref"]} {["T5-Ref"]} {["T6-Ref"]} {["Fz-Ref"]} {["Cz-Ref"]} {["Pz-Ref"]} {["POL E"]} {["POL PG1"]}
{["O2-Ref"]} {["F7-Ref"]} {["F8-Ref"]} {["T3-Ref"]} {["T4-Ref"]} {["T5-Ref"]} {["T6-Ref"]} {["Fz-Ref"]} {["Cz-Ref"]} {["Pz-Ref"]} {["POL E"]} {["POL PG1"]}
Columns 26 through 36
{["POL PG2"]} {["A1-Ref"]} {["A2-Ref"]} {["POL T1"]} {["POL T2"]} {["POL X1"]} {["POL X2"]} {["POL DC01"]} {["POL DC02"]} {["POL DC03"]} {["POL $A1" ]}
{["POL PG2"]} {["A1-Ref"]} {["A2-Ref"]} {["POL T1"]} {["POL T2"]} {["POL X1"]} {["POL X2"]} {["POL DC01"]} {["POL DC02"]} {["POL DC03"]} {["POL $A1" ]}
{["POL PG2"]} {["A1-Ref"]} {["A2-Ref"]} {["POL T1"]} {["POL T2"]} {["POL X1"]} {["POL X2"]} {["POL X3" ]} {["POL X4" ]} {["POL DC01"]} {["POL DC02"]}
{["POL PG2"]} {["A1-Ref"]} {["A2-Ref"]} {["POL T1"]} {["POL T2"]} {["POL X1"]} {["POL X2"]} {["POL X3" ]} {["POL X4" ]} {["POL DC01"]} {["POL DC02"]}
{["POL PG2"]} {["A1-Ref"]} {["A2-Ref"]} {["POL T1"]} {["POL T2"]} {["POL X1"]} {["POL X2"]} {["POL DC01"]} {["POL DC02"]} {["POL DC03"]} {["POL $A1" ]}
{["POL PG2"]} {["A1-Ref"]} {["A2-Ref"]} {["POL T1"]} {["POL T2"]} {["POL X1"]} {["POL X2"]} {["POL DC01"]} {["POL DC02"]} {["POL DC03"]} {["POL $A1" ]}
{["POL PG2"]} {["A1-Ref"]} {["A2-Ref"]} {["POL T1"]} {["POL T2"]} {["POL X1"]} {["POL X2"]} {["POL DC01"]} {["POL DC02"]} {["POL DC03"]} {["POL $A1" ]}
{["POL PG2"]} {["A1-Ref"]} {["A2-Ref"]} {["POL T1"]} {["POL T2"]} {["POL X1"]} {["POL X2"]} {["POL X3" ]} {["POL X4" ]} {["POL DC01"]} {["POL DC02"]}
{["POL PG2"]} {["A1-Ref"]} {["A2-Ref"]} {["POL T1"]} {["POL T2"]} {["POL X1"]} {["POL X2"]} {["POL X3" ]} {["POL X4" ]} {["POL DC01"]} {["POL DC02"]}
{["POL PG2"]} {["A1-Ref"]} {["A2-Ref"]} {["POL T1"]} {["POL T2"]} {["POL X1"]} {["POL X2"]} {["POL X3" ]} {["POL X4" ]} {["POL DC01"]} {["POL DC02"]}
{["POL PG2"]} {["A1-Ref"]} {["A2-Ref"]} {["POL T1"]} {["POL T2"]} {["POL X1"]} {["POL X2"]} {["POL X3" ]} {["POL X4" ]} {["POL DC01"]} {["POL DC02"]}
{["POL PG2"]} {["A1-Ref"]} {["A2-Ref"]} {["POL T1"]} {["POL T2"]} {["POL X1"]} {["POL X2"]} {["POL $A1" ]} {["POL $A2" ]} {["" ]} {["" ]}
{["POL PG2"]} {["A1-Ref"]} {["A2-Ref"]} {["POL T1"]} {["POL T2"]} {["POL X1"]} {["POL X2"]} {["POL $A1" ]} {["POL $A2" ]} {["" ]} {["" ]}
{["POL PG2"]} {["A1-Ref"]} {["A2-Ref"]} {["POL T1"]} {["POL T2"]} {["POL X1"]} {["POL X2"]} {["POL $A1" ]} {["POL $A2" ]} {["" ]} {["" ]}
{["POL PG2"]} {["A1-Ref"]} {["A2-Ref"]} {["POL T1"]} {["POL T2"]} {["POL X1"]} {["POL X2"]} {["POL $A1" ]} {["POL $A2" ]} {["" ]} {["" ]}
{["POL PG2"]} {["A1-Ref"]} {["A2-Ref"]} {["POL T1"]} {["POL T2"]} {["POL X1"]} {["POL X2"]} {["POL $A1" ]} {["POL $A2" ]} {["" ]} {["" ]}
Columns 37 through 47
{["POL $A2" ]} {["" ]} {["" ]} {["" ]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]}
{["POL $A2" ]} {["" ]} {["" ]} {["" ]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]}
{["POL DC03"]} {["POL DC04"]} {["POL $A1"]} {["POL $A2"]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]}
{["POL DC03"]} {["POL DC04"]} {["POL $A1"]} {["POL $A2"]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]}
{["POL $A2" ]} {["" ]} {["" ]} {["" ]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]}
{["POL $A2" ]} {["" ]} {["" ]} {["" ]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]}
{["POL $A2" ]} {["" ]} {["" ]} {["" ]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]}
{["POL DC03"]} {["POL DC04"]} {["POL $A1"]} {["POL $A2"]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]}
{["POL DC03"]} {["POL DC04"]} {["POL $A1"]} {["POL $A2"]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]}
{["POL DC03"]} {["POL DC04"]} {["POL $A1"]} {["POL $A2"]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]}
{["POL DC03"]} {["POL DC04"]} {["POL $A1"]} {["POL $A2"]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]}
{["" ]} {["" ]} {["" ]} {["" ]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]}
{["" ]} {["" ]} {["" ]} {["" ]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]}
{["" ]} {["" ]} {["" ]} {["" ]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]}
{["" ]} {["" ]} {["" ]} {["" ]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]}
{["" ]} {["" ]} {["" ]} {["" ]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]} {[""]}
2 件のコメント
Matt J
2023 年 6 月 22 日
But why have a cell array at all? Why not just make infon2 into a big string matrix,
load infon2
c=infon2(:,end);
L=max(cellfun(@numel,c));
for i=1:numel(c)
c{i}(end+1:L)="";
end
c=vertcat(c{:});
infon2=[string(infon2(:,1:end-1)) , c];
その他の回答 (1 件)
Stephen23
2023 年 6 月 22 日
Why are you storing numeric data as text? That must make data processing very awkward: most likely better data design would be to use e.g. a table, which lets you keep all of the data types of each column i.e. store and process numeric data as numeric.
S = load('infon2.mat');
C = S.infon2
C = 240×5 cell array
{'1' } {'200' } {'150.995'} {'common'} {["Fp1-Ref" "Fp2-Ref" … ]}
{'2' } {'200' } {'96.995' } {'common'} {["Fp1-Ref" "Fp2-Ref" … ]}
{'3' } {'200' } {'219.995'} {'common'} {["Fp1-Ref" "Fp2-Ref" … ]}
{'4' } {'200' } {'68.995' } {'common'} {["Fp1-Ref" "Fp2-Ref" … ]}
{'5' } {'200' } {'289.995'} {'common'} {["Fp1-Ref" "Fp2-Ref" … ]}
{'6' } {'200' } {'824.995'} {'common'} {["Fp1-Ref" "Fp2-Ref" … ]}
{'7' } {'200' } {'218.995'} {'common'} {["Fp1-Ref" "Fp2-Ref" … ]}
{'8' } {'200' } {'217.995'} {'common'} {["Fp1-Ref" "Fp2-Ref" … ]}
{'9' } {'200' } {'58.995' } {'common'} {["Fp1-Ref" "Fp2-Ref" … ]}
{'10'} {'200' } {'57.995' } {'common'} {["Fp1-Ref" "Fp2-Ref" … ]}
{'11'} {'200' } {'43.995' } {'common'} {["Fp1-Ref" "Fp2-Ref" … ]}
{'12'} {'1000'} {'41.579' } {'common'} {["Fp1-Ref" "Fp2-Ref" … ]}
{'13'} {'200' } {'248.995'} {'common'} {["Fp1-Ref" "Fp2-Ref" … ]}
{'14'} {'200' } {'319.995'} {'common'} {["Fp1-Ref" "Fp2-Ref" … ]}
{'15'} {'200' } {'109.995'} {'common'} {["Fp1-Ref" "Fp2-Ref" … ]}
{'16'} {'200' } {'89.995' } {'common'} {["Fp1-Ref" "Fp2-Ref" … ]}
N = size(C,1);
D = cell(N,0);
for k = 1:N
V = cellstr(C{k,5});
D(k,1:numel(V)) = V;
end
D = [C(:,1:4),D]
D = 240×47 cell array
Columns 1 through 14
{'1' } {'200' } {'150.995'} {'common'} {'Fp1-Ref'} {'Fp2-Ref'} {'F3-Ref'} {'F4-Ref'} {'C3-Ref'} {'C4-Ref'} {'P3-Ref'} {'P4-Ref'} {'O1-Ref'} {'O2-Ref'}
{'2' } {'200' } {'96.995' } {'common'} {'Fp1-Ref'} {'Fp2-Ref'} {'F3-Ref'} {'F4-Ref'} {'C3-Ref'} {'C4-Ref'} {'P3-Ref'} {'P4-Ref'} {'O1-Ref'} {'O2-Ref'}
{'3' } {'200' } {'219.995'} {'common'} {'Fp1-Ref'} {'Fp2-Ref'} {'F3-Ref'} {'F4-Ref'} {'C3-Ref'} {'C4-Ref'} {'P3-Ref'} {'P4-Ref'} {'O1-Ref'} {'O2-Ref'}
{'4' } {'200' } {'68.995' } {'common'} {'Fp1-Ref'} {'Fp2-Ref'} {'F3-Ref'} {'F4-Ref'} {'C3-Ref'} {'C4-Ref'} {'P3-Ref'} {'P4-Ref'} {'O1-Ref'} {'O2-Ref'}
{'5' } {'200' } {'289.995'} {'common'} {'Fp1-Ref'} {'Fp2-Ref'} {'F3-Ref'} {'F4-Ref'} {'C3-Ref'} {'C4-Ref'} {'P3-Ref'} {'P4-Ref'} {'O1-Ref'} {'O2-Ref'}
{'6' } {'200' } {'824.995'} {'common'} {'Fp1-Ref'} {'Fp2-Ref'} {'F3-Ref'} {'F4-Ref'} {'C3-Ref'} {'C4-Ref'} {'P3-Ref'} {'P4-Ref'} {'O1-Ref'} {'O2-Ref'}
{'7' } {'200' } {'218.995'} {'common'} {'Fp1-Ref'} {'Fp2-Ref'} {'F3-Ref'} {'F4-Ref'} {'C3-Ref'} {'C4-Ref'} {'P3-Ref'} {'P4-Ref'} {'O1-Ref'} {'O2-Ref'}
{'8' } {'200' } {'217.995'} {'common'} {'Fp1-Ref'} {'Fp2-Ref'} {'F3-Ref'} {'F4-Ref'} {'C3-Ref'} {'C4-Ref'} {'P3-Ref'} {'P4-Ref'} {'O1-Ref'} {'O2-Ref'}
{'9' } {'200' } {'58.995' } {'common'} {'Fp1-Ref'} {'Fp2-Ref'} {'F3-Ref'} {'F4-Ref'} {'C3-Ref'} {'C4-Ref'} {'P3-Ref'} {'P4-Ref'} {'O1-Ref'} {'O2-Ref'}
{'10'} {'200' } {'57.995' } {'common'} {'Fp1-Ref'} {'Fp2-Ref'} {'F3-Ref'} {'F4-Ref'} {'C3-Ref'} {'C4-Ref'} {'P3-Ref'} {'P4-Ref'} {'O1-Ref'} {'O2-Ref'}
{'11'} {'200' } {'43.995' } {'common'} {'Fp1-Ref'} {'Fp2-Ref'} {'F3-Ref'} {'F4-Ref'} {'C3-Ref'} {'C4-Ref'} {'P3-Ref'} {'P4-Ref'} {'O1-Ref'} {'O2-Ref'}
{'12'} {'1000'} {'41.579' } {'common'} {'Fp1-Ref'} {'Fp2-Ref'} {'F3-Ref'} {'F4-Ref'} {'C3-Ref'} {'C4-Ref'} {'P3-Ref'} {'P4-Ref'} {'O1-Ref'} {'O2-Ref'}
{'13'} {'200' } {'248.995'} {'common'} {'Fp1-Ref'} {'Fp2-Ref'} {'F3-Ref'} {'F4-Ref'} {'C3-Ref'} {'C4-Ref'} {'P3-Ref'} {'P4-Ref'} {'O1-Ref'} {'O2-Ref'}
{'14'} {'200' } {'319.995'} {'common'} {'Fp1-Ref'} {'Fp2-Ref'} {'F3-Ref'} {'F4-Ref'} {'C3-Ref'} {'C4-Ref'} {'P3-Ref'} {'P4-Ref'} {'O1-Ref'} {'O2-Ref'}
{'15'} {'200' } {'109.995'} {'common'} {'Fp1-Ref'} {'Fp2-Ref'} {'F3-Ref'} {'F4-Ref'} {'C3-Ref'} {'C4-Ref'} {'P3-Ref'} {'P4-Ref'} {'O1-Ref'} {'O2-Ref'}
{'16'} {'200' } {'89.995' } {'common'} {'Fp1-Ref'} {'Fp2-Ref'} {'F3-Ref'} {'F4-Ref'} {'C3-Ref'} {'C4-Ref'} {'P3-Ref'} {'P4-Ref'} {'O1-Ref'} {'O2-Ref'}
Columns 15 through 28
{'F7-Ref'} {'F8-Ref'} {'T3-Ref'} {'T4-Ref'} {'T5-Ref'} {'T6-Ref'} {'Fz-Ref'} {'Cz-Ref'} {'Pz-Ref'} {'POL E'} {'POL PG1'} {'POL PG2'} {'A1-Ref'} {'A2-Ref'}
{'F7-Ref'} {'F8-Ref'} {'T3-Ref'} {'T4-Ref'} {'T5-Ref'} {'T6-Ref'} {'Fz-Ref'} {'Cz-Ref'} {'Pz-Ref'} {'POL E'} {'POL PG1'} {'POL PG2'} {'A1-Ref'} {'A2-Ref'}
{'F7-Ref'} {'F8-Ref'} {'T3-Ref'} {'T4-Ref'} {'T5-Ref'} {'T6-Ref'} {'Fz-Ref'} {'Cz-Ref'} {'Pz-Ref'} {'POL E'} {'POL PG1'} {'POL PG2'} {'A1-Ref'} {'A2-Ref'}
{'F7-Ref'} {'F8-Ref'} {'T3-Ref'} {'T4-Ref'} {'T5-Ref'} {'T6-Ref'} {'Fz-Ref'} {'Cz-Ref'} {'Pz-Ref'} {'POL E'} {'POL PG1'} {'POL PG2'} {'A1-Ref'} {'A2-Ref'}
{'F7-Ref'} {'F8-Ref'} {'T3-Ref'} {'T4-Ref'} {'T5-Ref'} {'T6-Ref'} {'Fz-Ref'} {'Cz-Ref'} {'Pz-Ref'} {'POL E'} {'POL PG1'} {'POL PG2'} {'A1-Ref'} {'A2-Ref'}
{'F7-Ref'} {'F8-Ref'} {'T3-Ref'} {'T4-Ref'} {'T5-Ref'} {'T6-Ref'} {'Fz-Ref'} {'Cz-Ref'} {'Pz-Ref'} {'POL E'} {'POL PG1'} {'POL PG2'} {'A1-Ref'} {'A2-Ref'}
{'F7-Ref'} {'F8-Ref'} {'T3-Ref'} {'T4-Ref'} {'T5-Ref'} {'T6-Ref'} {'Fz-Ref'} {'Cz-Ref'} {'Pz-Ref'} {'POL E'} {'POL PG1'} {'POL PG2'} {'A1-Ref'} {'A2-Ref'}
{'F7-Ref'} {'F8-Ref'} {'T3-Ref'} {'T4-Ref'} {'T5-Ref'} {'T6-Ref'} {'Fz-Ref'} {'Cz-Ref'} {'Pz-Ref'} {'POL E'} {'POL PG1'} {'POL PG2'} {'A1-Ref'} {'A2-Ref'}
{'F7-Ref'} {'F8-Ref'} {'T3-Ref'} {'T4-Ref'} {'T5-Ref'} {'T6-Ref'} {'Fz-Ref'} {'Cz-Ref'} {'Pz-Ref'} {'POL E'} {'POL PG1'} {'POL PG2'} {'A1-Ref'} {'A2-Ref'}
{'F7-Ref'} {'F8-Ref'} {'T3-Ref'} {'T4-Ref'} {'T5-Ref'} {'T6-Ref'} {'Fz-Ref'} {'Cz-Ref'} {'Pz-Ref'} {'POL E'} {'POL PG1'} {'POL PG2'} {'A1-Ref'} {'A2-Ref'}
{'F7-Ref'} {'F8-Ref'} {'T3-Ref'} {'T4-Ref'} {'T5-Ref'} {'T6-Ref'} {'Fz-Ref'} {'Cz-Ref'} {'Pz-Ref'} {'POL E'} {'POL PG1'} {'POL PG2'} {'A1-Ref'} {'A2-Ref'}
{'F7-Ref'} {'F8-Ref'} {'T3-Ref'} {'T4-Ref'} {'T5-Ref'} {'T6-Ref'} {'Fz-Ref'} {'Cz-Ref'} {'Pz-Ref'} {'POL E'} {'POL PG1'} {'POL PG2'} {'A1-Ref'} {'A2-Ref'}
{'F7-Ref'} {'F8-Ref'} {'T3-Ref'} {'T4-Ref'} {'T5-Ref'} {'T6-Ref'} {'Fz-Ref'} {'Cz-Ref'} {'Pz-Ref'} {'POL E'} {'POL PG1'} {'POL PG2'} {'A1-Ref'} {'A2-Ref'}
{'F7-Ref'} {'F8-Ref'} {'T3-Ref'} {'T4-Ref'} {'T5-Ref'} {'T6-Ref'} {'Fz-Ref'} {'Cz-Ref'} {'Pz-Ref'} {'POL E'} {'POL PG1'} {'POL PG2'} {'A1-Ref'} {'A2-Ref'}
{'F7-Ref'} {'F8-Ref'} {'T3-Ref'} {'T4-Ref'} {'T5-Ref'} {'T6-Ref'} {'Fz-Ref'} {'Cz-Ref'} {'Pz-Ref'} {'POL E'} {'POL PG1'} {'POL PG2'} {'A1-Ref'} {'A2-Ref'}
{'F7-Ref'} {'F8-Ref'} {'T3-Ref'} {'T4-Ref'} {'T5-Ref'} {'T6-Ref'} {'Fz-Ref'} {'Cz-Ref'} {'Pz-Ref'} {'POL E'} {'POL PG1'} {'POL PG2'} {'A1-Ref'} {'A2-Ref'}
Columns 29 through 40
{'POL T1'} {'POL T2'} {'POL X1'} {'POL X2'} {'POL DC01'} {'POL DC02'} {'POL DC03'} {'POL $A1' } {'POL $A2' } {0×0 double} {0×0 double} {0×0 double}
{'POL T1'} {'POL T2'} {'POL X1'} {'POL X2'} {'POL DC01'} {'POL DC02'} {'POL DC03'} {'POL $A1' } {'POL $A2' } {0×0 double} {0×0 double} {0×0 double}
{'POL T1'} {'POL T2'} {'POL X1'} {'POL X2'} {'POL X3' } {'POL X4' } {'POL DC01'} {'POL DC02'} {'POL DC03'} {'POL DC04'} {'POL $A1' } {'POL $A2' }
{'POL T1'} {'POL T2'} {'POL X1'} {'POL X2'} {'POL X3' } {'POL X4' } {'POL DC01'} {'POL DC02'} {'POL DC03'} {'POL DC04'} {'POL $A1' } {'POL $A2' }
{'POL T1'} {'POL T2'} {'POL X1'} {'POL X2'} {'POL DC01'} {'POL DC02'} {'POL DC03'} {'POL $A1' } {'POL $A2' } {0×0 double} {0×0 double} {0×0 double}
{'POL T1'} {'POL T2'} {'POL X1'} {'POL X2'} {'POL DC01'} {'POL DC02'} {'POL DC03'} {'POL $A1' } {'POL $A2' } {0×0 double} {0×0 double} {0×0 double}
{'POL T1'} {'POL T2'} {'POL X1'} {'POL X2'} {'POL DC01'} {'POL DC02'} {'POL DC03'} {'POL $A1' } {'POL $A2' } {0×0 double} {0×0 double} {0×0 double}
{'POL T1'} {'POL T2'} {'POL X1'} {'POL X2'} {'POL X3' } {'POL X4' } {'POL DC01'} {'POL DC02'} {'POL DC03'} {'POL DC04'} {'POL $A1' } {'POL $A2' }
{'POL T1'} {'POL T2'} {'POL X1'} {'POL X2'} {'POL X3' } {'POL X4' } {'POL DC01'} {'POL DC02'} {'POL DC03'} {'POL DC04'} {'POL $A1' } {'POL $A2' }
{'POL T1'} {'POL T2'} {'POL X1'} {'POL X2'} {'POL X3' } {'POL X4' } {'POL DC01'} {'POL DC02'} {'POL DC03'} {'POL DC04'} {'POL $A1' } {'POL $A2' }
{'POL T1'} {'POL T2'} {'POL X1'} {'POL X2'} {'POL X3' } {'POL X4' } {'POL DC01'} {'POL DC02'} {'POL DC03'} {'POL DC04'} {'POL $A1' } {'POL $A2' }
{'POL T1'} {'POL T2'} {'POL X1'} {'POL X2'} {'POL $A1' } {'POL $A2' } {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}
{'POL T1'} {'POL T2'} {'POL X1'} {'POL X2'} {'POL $A1' } {'POL $A2' } {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}
{'POL T1'} {'POL T2'} {'POL X1'} {'POL X2'} {'POL $A1' } {'POL $A2' } {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}
{'POL T1'} {'POL T2'} {'POL X1'} {'POL X2'} {'POL $A1' } {'POL $A2' } {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}
{'POL T1'} {'POL T2'} {'POL X1'} {'POL X2'} {'POL $A1' } {'POL $A2' } {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}
Columns 41 through 47
{0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}
{0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}
{0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}
{0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}
{0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}
{0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}
{0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}
{0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}
{0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}
{0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}
{0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}
{0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}
{0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}
{0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}
{0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}
{0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}
"eventually write out the complete lsit to an excel"
writecell(D,'mytable.xlsx')
8 件のコメント
Joanne Hall
2023 年 6 月 22 日
... might there be an easy way to remove the '-ref' ending from all channel locations labels in this list?
Thanks again for the above code Its prefect!
JOanne
Joanne Hall
2023 年 6 月 22 日
It does get rid of 'ref! but for some channels, without the '-ref' ending, like '"POL E" ,"POL PG1", "POL PG2"', it replaces those cells with 'missing'
Stephen23
2023 年 6 月 22 日
編集済み: Stephen23
2023 年 6 月 22 日
I would use either STRREP or REGEXPREP, which will not replace your data with "missing":
A = ["FP1-Ref", "FP2-Ref", "POL E", "POL PG1", "POL PG2"];
B = strrep(A,'-Ref','')
B = 1×5 string array
"FP1" "FP2" "POL E" "POL PG1" "POL PG2"
B = regexprep(A,'-Ref$','')
B = 1×5 string array
"FP1" "FP2" "POL E" "POL PG1" "POL PG2"
Note that "extracting before something" has no meaning when that something does not exist. In contrast, using the correct functions works as expected.
Joanne Hall
2023 年 6 月 22 日
編集済み: Joanne Hall
2023 年 6 月 22 日
I just want to say thanks again to both Stephne and Matt, because I'm using things both have taugh me today in my other codes. so much appreciated. And its the little kindnesses that you do in your day that really make a difference in people's lives and jobs.
参考
カテゴリ
Help Center および File Exchange で Tables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
アジア太平洋地域
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)