Rank: 4796 based on 3 downloads (last 30 days) and 1 file submitted
photo

janez

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by janez
Updated   File Tags Downloads
(last 30 days)
Comments Rating
09 Sep 2010 isblank.m Determines if the argument string consists only of blanks. Author: janez blanks, data import, data export, measurement 3 5
  • 2.0
2.0 | 1 rating
Comments and Ratings by janez View all
Updated File Comments Rating
09 Sep 2010 isblank.m Determines if the argument string consists only of blanks. Author: janez

thanks for your comments oleg. they were very useful and also my timings indicate all(isspace(x)) solution is most of the time 1.5-2 times faster than isblank and the x = all(x==blanks(length(x))) solution is about 20% faster.

i also noticed my complicated code is sometimes faster - how is that possible indeed? but good point there too: speedwise my code is the worst most of the time.

i'm sure it's clear from this which solution to use ;) but i'll keep my file posted anyway for pedagogical purposes - i don't want to extinguish your comment.

03 Dec 2009 ncx, NetCDF eXplorer Interface for NetCDF visualisation Author: M MA

i'm running Matlab R2008a and cannot get ncx to work. when i try to load the file, i get the following error:
??? Error using ==> feval
Invalid MEX-file 'C:\Program Files\MATLAB\R2008a\work\ecomviz\ncx\netcdf\mexcdf\pcwin\mexcdf53.dll': C:\Program
Files\MATLAB\R2008a\work\ecomviz\ncx\netcdf\mexcdf\pcwin\mexcdf53.dll is not a valid Win32 program.

i tried to do what Mark Brandon suggested above but i cannot find mexcdf53.dll file in the latest sourcefourge directory and the error keeps repeating and the ncx doesn't work.
it's such a tease!
any thoughts anyone?

i tried substituting

Comments and Ratings on janez's Files View all
Updated File Comment by Comments Rating
09 Sep 2010 isblank.m Determines if the argument string consists only of blanks. Author: janez Qi, Binbin

also, all(x==' ')
           all(isspace(x))

09 Sep 2010 isblank.m Determines if the argument string consists only of blanks. Author: janez Qi, Binbin

I think the main engine can be simplified:
                    x=length(deblank(x))==0

09 Sep 2010 isblank.m Determines if the argument string consists only of blanks. Author: janez Simon, Jan

You can omit the call of BLANKS:
  x = all(x==blanks(length(x)));
Faster (does not overwrite x, considers matrices):
  y = all(x(:)==' ');
But ISSPACE catchs other invisible characters also:
  y = all(x(:) <= ' '); % or <= 32
Because all characters with ASCII < 33 are invisible.

09 Sep 2010 isblank.m Determines if the argument string consists only of blanks. Author: janez janez

thanks for your comments oleg. they were very useful and also my timings indicate all(isspace(x)) solution is most of the time 1.5-2 times faster than isblank and the x = all(x==blanks(length(x))) solution is about 20% faster.

i also noticed my complicated code is sometimes faster - how is that possible indeed? but good point there too: speedwise my code is the worst most of the time.

i'm sure it's clear from this which solution to use ;) but i'll keep my file posted anyway for pedagogical purposes - i don't want to extinguish your comment.

08 Sep 2010 isblank.m Determines if the argument string consists only of blanks. Author: janez Komarov, Oleg

Help and H1 line may be improved. No examples. No history.

Fails if matrix char:
x = [' '
      ' '];

Also I would rather go for all(isspace(x))) even though my timings indicate that isblank can be ?faster?

The main engine can be simplified:
x = all(x==blanks(length(x)));

Oleg

Top Tags Applied by janez
blanks, data export, data import, measurement
Files Tagged by janez
Updated   File Tags Downloads
(last 30 days)
Comments Rating
09 Sep 2010 isblank.m Determines if the argument string consists only of blanks. Author: janez blanks, data import, data export, measurement 3 5
  • 2.0
2.0 | 1 rating

Contact us at files@mathworks.com