想知道怎么完全随机来显现字组?不是前一半积极词在左,后一半在右这种,而是完全打乱的那种
positive={'喜悦','开心'};
negative={'难过','悲伤'};
count=0;
for i=1:length(positive)
for j=1:length(negative)
count=count+1;
StimInd(count).word1=positive{i};
StimInd(count).word2=negative{j};
end
end
for n=1:i*j
StimInd(i*j+n).word1=StimInd(n).word2;
StimInd(i*j+n).word2=StimInd(n).word1;
end
引用上课大佬们的代码
negative={'难过','悲伤'};
count=0;
for i=1:length(positive)
for j=1:length(negative)
count=count+1;
StimInd(count).word1=positive{i};
StimInd(count).word2=negative{j};
end
end
for n=1:i*j
StimInd(i*j+n).word1=StimInd(n).word2;
StimInd(i*j+n).word2=StimInd(n).word1;
end
引用上课大佬们的代码