Finding mean of ascii values in a string MATLAB -


the string given follows:

scrap1 =  le h ke fd  zyq  b  ner 

you'll notice there 2 blank spaces indicating space (ascii 32) in each row. need find mean ascii value in each column without taking account spaces (32). first convert double(scrap1) how find mean without taking account spaces?

if it's ascii 32 want omit:

d = double(scrap1); result = mean(d(d~=32)); %// logical indexing remove unwanted value, mean 

Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -