"Unable to perform assignment because the size of the left side is 1-by-3 and the size of the right side is 6-by-1." - I need help

조회 수: 3 (최근 30일)
get the error at the bolded line
if makegraphs
figure('NumberTitle', 'off', 'Name', 'Sessions with Cues and Transients','units','normalized','outerposition',[0 0 1 1]); clf; hold on
stepup = 0;
for abc = animalnumber
stepup = -5*abc;
plot(data(abc).time,data(abc).sigfilt+stepup,'Color',[0 0.6 0])
plot(data(abc).locs./fsg1,data(abc).pks+stepup,'o','Color',[0.6 0 0],'LineWidth',2)
if isfield(data,'pluscue')
for xyz = 1:numel(data(abc).pluscue)
line([data(abc).cuemark(xyz) data(abc).cuemark(xyz)],[-.5+stepup .5+stepup],'Color',[1 0 0],'LineWidth',2);
end
end
text(max(data(abc).time),stepup,[data(abc).animal,'-',data(abc).conditions,' (' num2str(numel(data(abc).pks)/data(abc).tg(end)*60), ' trans/min)'])
end
end
if isfield(data,'structlocs')
for abc = animalnumber
uniquevectorprep{abc} = [data(abc).conditions];
end
C = cellstr(unique(uniquevectorprep));
C = C';Dopamine
else
for abc = animalnumber
uniquevectorprep{abc} = [data(abc).conditions];
end
C = cellstr(unique(uniquevectorprep));
C = C';
for abc = 1:size(C,1)
for xyz = animalnumber
if strcmp(data(xyz).conditions,C{abc})==1
structlocs(xyz,abc) = 1;
end
end
data(abc).condcomb = C{abc};
data(abc).structlocs = find(structlocs(:,abc)==1);
end
end
if quant1
figure('NumberTitle', 'off', 'Name', 'Transients Per Minute'); clf; hold on;
for abc = animalnumber
data(abc).transpmin = numel(data(abc).pks)/data(abc).tg(end)*60;
end
for abc = 1:size(C,1)
data(abc).meantranspmin = nanmean([data(data(abc).structlocs).transpmin]);
data(abc).SEMtranspmin = nanstd([data(data(abc).structlocs).transpmin],0,2)./(sqrt(numel([data(data(abc).structlocs).transpmin])));
end
animalcolor = distinguishable_colors(length(C));
plt= bar(categorical(C),[data.meantranspmin],'FaceColor','flat','LineWidth',2);
xslot = get(plt,'XData');
for abc = 1:size(C,1)
pltpt = plot(xslot(abc),[data(data(abc).structlocs).transpmin],'.','Color','k','MarkerSize',14);
freqD(:,abc) = [data(data(abc).structlocs).transpmin];
plt.CData(abc,:) = figcol(:,abc);
end
errorbar(1:size(C,1),[data.meantranspmin],[data.SEMtranspmin],'.','Color','k','LineWidth',2)
ylabel('Transients per Minute')
title('Transient Frequency')
xcoord = get(gca,'xLim'); xcoord = xcoord(1);
ycoord = get(gca,'yLim'); ycoord = ycoord(2)-(diff(ycoord)/15);
text(xcoord,ycoord,{['n = ', num2str(size(uani,2))]}, 'HorizontalAlignment', 'center')
if print1
set(gcf,'renderer','Painters')
print('transFreq','-depsc')
end
figure('NumberTitle', 'off', 'Name', 'Peak Amplitude'); clf; hold on;
for abc = animalnumber
data(abc).mpks = mean(data(abc).pks);
end
for abc = 1:size(C,1)
data(abc).meanpks = nanmean([data(data(abc).structlocs).mpks]);
data(abc).SEMpks = nanstd([data(data(abc).structlocs).mpks],0,2)./(sqrt(numel([data(data(abc).structlocs).mpks])));
end
animalcolor = distinguishable_colors(length(C));
plt= bar(categorical(C),[data.meanpks],'FaceColor','flat','LineWidth',2);
xslot = get(plt,'XData');
for abc = 1:size(C,1)
pltpt = plot(xslot(abc),[data(data(abc).structlocs).mpks],'.','Color','k','MarkerSize',14);
ampD(:,abc) = [data(data(abc).structlocs).mpks];
plt.CData(abc,:) = figcol(:,abc);
end
errorbar(1:size(C,1),[data.meanpks],[data.SEMpks],'.','Color','k','LineWidth',2)
ylabel('dF/F')
title('Peak Amplitude')
xcoord = get(gca,'xLim'); xcoord = xcoord(1);
ycoord = get(gca,'yLim'); ycoord = ycoord(2)-(diff(ycoord)/15);
text(xcoord,ycoord,{['n = ', num2str(size(uani,2))]}, 'HorizontalAlignment', 'center')
if print1
set(gcf,'renderer','Painters')
print('transAmp','-depsc')
end
else
freqD = 0;
ampD = 0;
end
and then another one here (bolded)
if strcmp(transThreshType,'session')
[data,uani,ucond,freqD,ampD] = countTransients(data,numstd,animalnumber,0,expdsn,fsg1,quant1,print1,figcol,makegraphs);
[data] = normMethod(data,animalnumber,salvec,expdsn,normMethodType);
elseif strcmp(transThreshType,'vehicle')
[data,uani,ucond,~,~] = countTransients(data,numstd,animalnumber,salvec,expdsn,fsg1,quant1,print1,figcol,makegraphs);
[data] = normMethod(data,animalnumber,salvec,expdsn,normMethodType);
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by