フィルターのクリア

mulptiply each column of a cell matrix by 4 when it contains strings and NaN

1 回表示 (過去 30 日間)
Sabbas
Sabbas 2012 年 7 月 27 日
Dear all
I have
Aq = {
'adidas' 'shoes' 'wow'
[ 0.6692] [ 0.8646] [8.7778e+003]
[ 0.6692] [ 0.8646] [8.7778e+003]
[ 0.6574] [ 0.9949] [5.8947e+003]
[ 0.6574] [ 0.9949] [5.8947e+003]
[ 0.6515] [ 0.7855] [9.0872e+003]
[ 0.6515] [NaN] [9.0872e+003]
[ 0.6668] [ 0.9097] [4.5158e+003]
[ 0.6668] [ 0.9097] [4.5158e+003]
[ 0.6461] [ 0.7369] [1.3001e+004]
[ 0.6461] [ 0.7369] [NaN]
[ 0.6666] [ 0.8229] [9.2713e+003]
[ 0.6666] [ 0.8229] [9.2713e+003]
[ 0.6156] [ 0.7726] [9.1033e+003]
[ 0.6156] [ 0.7726] [9.1033e+003]
[ 0.5855] [ 0.7962] [6.1476e+003]
[ 0.5855] [ 0.7962] [6.1476e+003]
[ 0.5894] [ 0.7112] [9.4473e+003]}
I would like to multiply each column with 8
thanks

採用された回答

Andrei Bobrov
Andrei Bobrov 2012 年 7 月 27 日
t = ~cellfun(@ischar,Aq);
Aq(t) = cellfun(@(x)x*8,Aq(t),'un',0);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNaNs についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by