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

조회 수: 1 (최근 30일)
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 CenterFile Exchange에서 NaNs에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by