Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
セル(269x500)で構成される変数classiがあります。これは、 http: //ojtwist.be/data.matにあります。この行列の行を合計して、269x1のベクトルを取得しようとしています。変数をcell2matで行列に変換しようとしましたが、これは機能しません。または、matlabは記号(-)を個別のセルと見なします。したがって、私は使用できませんsum(classi(:),2)。私の質問は、どうすればこれを効率的に行うことができるかということです。
sum(classi(:),2)
どうも
これがあなたがそれをすることができる方法です:
load data.mat a = sum( cellfun(@str2double, classi), 2);