replace cell array row with another cell array

6 ビュー (過去 30 日間)
Maria K
Maria K 2018 年 2 月 12 日
コメント済み: Maria K 2018 年 2 月 12 日
Hello!!
I have this cell array:
trials = {'orientations', '-18', '-36', '-54', '-72', '-90', '-108' '-126' '-144' '-162' ;
'trials', [11 13] [1 10] [7 17] [12 18] [8 14] [5 15] [9 16] [2 3] [4 6]; 'answers' [] [] [] [] [] [] [] [] []};
I want to replace every empty column of the thrird row with an element from the cell array of the form:
cell = {'[0 0]' '[0 0]' '[0 0]' '[1 1]' '[0 0]' '[1 1]' '[1 1]' '[1 1]' '[1 0]'};
To be more clear, the end result should look like that :
trials = {'orientations', '-18', '-36', '-54', '-72', '-90', '-108' '-126' '-144' '-162' ;
'trials', [11 13] [1 10] [7 17] [12 18] [8 14] [5 15] [9 16] [2 3] [4 6]; 'answers' [0 0] [0 0] [0 0] [1 1] [0 0] [1 1] [1 1] [1 1] [1 0]};
I have put the command trials(3, 2: end) = cell(1, 1: end); in my script but nothing happens..It only works if i run my script and afterwards run this command in cmd.. Any ideas why this happens or how I can get the result I want?
Thanks on advance,
~M.

回答 (1 件)

Walter Roberson
Walter Roberson 2018 年 2 月 12 日
trials(3, 2:end) = cell;
but you are going to have problems with using a variable named cell as that is a key function to create new cell arrays.
  4 件のコメント
Maria K
Maria K 2018 年 2 月 12 日
In this script I also use commands from psychtoolbox but the problem is not there anyway. The problem is from line 250 to line 301.
Thanks for your time!!!
Maria K
Maria K 2018 年 2 月 12 日
I just noticed a cell array from the above was empty. Sorry for the inconvenience..

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeTiming and presenting 2D and 3D stimuli についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by