在循环索引的作品一样正常。我还做了一些其他的改动你的代码。
temp_array =零(____,numel(行为));
对于n = 1时:numel(行为)%行为是含有串的27x1单元阵列
温度=的strcmp(Shank2_KOs(k)的.BehaviourType,行为(N));%创建逻辑矢量
temp_array(:,N)=温度;
结束
2件のコメント
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/518318-creating-a-logical-array-within-a-loop#comment_828903
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/518318-creating-a-logical-array-within-a-loop#comment_828903
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/518318-creating-a-logical-array-within-a-loop#comment_828904
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/518318-creating-a-logical-array-within-a-loop#comment_828904
サインイン评论。