이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
unpack cell array of letters to be plugged into individual-cell rows, in a vector
조회 수: 7 (최근 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에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 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 (한국어)

