2011-06-20 2 views

答えて

1

私の推測では、あなたの構造体フィールドに保存された行列がcell arrayにカプセル化されていることであるので、あなたはuse curly braces {} to index the cell contents(すなわちコンテンツインデックス)にする必要があります。この例を考えてみましょう:

>> S.field1 = {1:5}; %# Create structure S with field 'field1' containing a cell 
         %# array which itself contains a 1-by-5 vector 
>> S.field1   %# Index just the field... 

ans = 

    [1x5 double]  %# ...and you see the sort of answer you were getting 

>> S.field1{1}  %# Index the field and remove the contents of the cell... 

ans = 

    1  2  3  4  5 %# ...and now you get the vector 

注:MATLAB物事の新しいバージョンでが少し異なって表示され、この混乱を回避することができます。ここに表示される内容は次のとおりです。

>> S.field1 

ans = 

    cell % Note now that it displays the type of data 

    [1×5 double] 
関連する問題