Rank: 6428 based on 16 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 16 5
  • 2.0
2.0 | 1 rating
Comments and Ratings by janez View all
Updated File Comments Rating
20 Sep 2013 Round off dates and times Rounds off a datenum to the nearest second, minute, hour, day, month or year. Author: Kevin J. Delaney

03 Jun 2013 Convert between world time zones with daylight saving times This is a very simple yet powerful function to convert a datenum from one timezone to another. Author: Erwin Mayer

Great tool. A word of warning though: as noticed by Matt Aldrich it doesn't accept multidimensional arrays. But if you loop sequentially over all array elements (datenumbers) it works like a charm.

29 Jan 2013 Tidal fitting toolbox fit tidal components to an observed series of sea level and use them for prediction Author: Aslak Grinsted

Very useful package and very easy to use. Worked right from the start with no problems. I also did a quick check and compared the results with t_tide package by R. Pawlowicz. Tidal forecasts from both packages were generated using the same 1-year (whole year 2011) timeseries of sea level measurements and compared to the the same measurements (whole year 2012). RMSE value of residuals (observed sea level - astronomical tide) were 16.04 cm (tidal_fit) and 15.30 cm (t_tide). The maximum/minimum times differ for up to 4 minutes. Qualitative and quantitative curve behavior is the same in both packages for the most time. As a rule of thumb i'd say the performance of both packages is very similar and consistent.

31 Aug 2012 Polar/cartesian into degree north reference Set of function to convert polar/cartesian coordinates into degrees north and inversely. Author: Arnaud Laurent

cart2compass engine can be simplified - you don't need three 'find'-s.

degN: angle in degree north system (N = 0 degrees, E = 90 degrees)
deg: cartesian angle (E = 0 degrees, N = 90 degrees)

then it follows:

degN = 90 - deg;
idx = find(degN < 0);
degN(idx) = degN(idx) + 360;

output:
deg =

0 45 90 135 180 225 270 315 360

degN =

90 45 0 315 270 225 180 135 90

regards!

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.

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

Contact us