Search Comments and Ratings

go

Comments and Ratings

   
Date File Comment by Comment Rating
11 Nov 2009 Euklid (Inverse) Distance Weight Matrix Calculates a weight matrix of any size using the (inverse) euklidean distance from center cell. Author: Felix Hebeler montes, carlo

thaks Felix... this W can be used with the morans_I.m??
regards!

05 Nov 2009 rsquare calculate rsquare from data y and estimate yhat Author: Felix Hebeler T, Petteri

sum( (y-yhat).^2) could be replaced with (y-what)' * (y-what) for speedup as suggested there: http://www.mathworks.nl/matlabcentral/newsreader/view_thread/168821

25 Apr 2009 Solar Radiation Calculates the hourly solar radiation (direct+diffuse+reflected) for a DEM integrated over on year Author: Felix Hebeler EIE, EIE

31 Jan 2009 PDD Melt Calculates melt for a DEM based on positive degree days factor Author: Felix Hebeler Carmichael, Joshua

Seems to work well. Would like to use shorter time periods.

27 Oct 2008 RMSE calculates root mean square error from data vector or matrix and the corresponding estimates. Author: Felix Hebeler Schwanghart, Wolfgang

Hi Felix and Gary,

yes, the two sums could be avoided by simply writing
r=sqrt(sum((data(:)-estimate(:)).^2)/numel(data))

The computation time is about the same but readability might be enhanced by using the colon operator.

Best regards,
Wolfgang

17 Oct 2008 Gaussian Convolution Filter Filter to introduce spatial autocorrelation while keeping original distribution. Author: Felix Hebeler med, lmode70

merçi merçi merçi merçi merçi merçi merçi merçi merçi merçi merçi merçi merçi merçi merçi merçi

10 Oct 2008 RMSE calculates root mean square error from data vector or matrix and the corresponding estimates. Author: Felix Hebeler Hebeler, Felix

@Gary: no, you need two sums if you process matrices, the first sums across all columns, the second then sums across the resulting vector. If you process vectors, the second sum calculates the sum of a scalar. Faster than checking for dimensions first.

09 Oct 2008 RMSE calculates root mean square error from data vector or matrix and the corresponding estimates. Author: Felix Hebeler Merkoske, Gary

you have one too many SUM() in the eqn, although it appears to be harmless. Am I correct? RMS Error is then;
r=sqrt(sum((data-estimate).^2)/numel(data))

11 Sep 2008 RMSE calculates root mean square error from data vector or matrix and the corresponding estimates. Author: Felix Hebeler Hebeler, Felix

Thanks for the feedback Wolfgang, I completely forgot that nansum needs the statistical toolbox, and of course you are right that it becomes incorrect with nans. I should have divided by numel(~isnan(data)), but deleting all NaNs in this case _is_ better! Your version actually would extract all NaNs and discard the values, so I used
I = ~isnan(data) & ~isnan(estimate); instead, which works a treat!

Durga, it's great you advertise your script on my page ;-) I see no point in input argument checking for this oneliner though - in my case I would have to reshape my matrices to use your script, not sure if that is better...

Anyway, once your script takes care of NaNs as suggested by Wolfgang, it is surely great as it calculates more than one goodness of fit.

10 Sep 2008 RMSE calculates root mean square error from data vector or matrix and the corresponding estimates. Author: Felix Hebeler Schwanghart, Wolfgang

Hi Felix,

the formula becomes incorrect as soon as you have nans in your arrays. You should remove nans first in both arrays

I = isnan(data) | isnan(estimate);
data = data(I);
estimate = estimate(I);

and then apply the formula. That even allows you to use sum instead of nansum, thereby avoiding dependence on the statistical toolbox.

09 Sep 2008 RMSE calculates root mean square error from data vector or matrix and the corresponding estimates. Author: Felix Hebeler Shrestha, Durga

This code is without input argument checking.

To compute more types of goodness of fit (including RMSE, coefficient of determination, mean absolute relative error etc.) please have a look
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=7968&objectType=file

09 Sep 2008 Sysshift Test two matrices (DEMs) for systematic shift / misregistration Author: Felix Hebeler Morsdorf, Felix

extremely helpful !!! and much quicker to download it from here then to get it from him personally :)

22 Aug 2008 Hillshade calculates a hillshade for a DEM (matrix) Author: Felix Hebeler Rosylee, Evana

hi,

i was refering to your code on finding the slope and aspect up til the gradient part.it really is good and it helps me alot.now,i have a DEM image of 1400x1400 in bitmap format,grayscale(0-255).I need to pick two points on the pixel in order for me to calculate the slope and aspect.my problem now is,how can i automatically run for every pixel in the image?i know i have to use the loop function but i don't know how.any suggestion is welcome..thank u~

17 Jul 2008 rsquare calculate rsquare from data y and estimate yhat Author: Felix Hebeler O'hEachach, Daithi

Does the job.

13 Mar 2008 Hillshade calculates a hillshade for a DEM (matrix) Author: Felix Hebeler Langella, Giuliano

I find very useful this function. I wonder if you have implemented also other hydrological/geomorphological functions in MatLab, such as PLAN/PROFILE curvatures, etc.

I suggest the following call to hillshade function in case of R reference matrix:
>> h = hillshade(Z, (R(3,1)+R(2,1)):R(2,1):(R(3,1)+size(Z,2)*R(2,1)), R(3,2)+R(1,2):R(1,2):(R(3,2)+size(Z,2)*R(1,2)));

with
R = [0,-cellsize; cellsize,0; up_left_pixel_X,up_left_pixel_Y];

Thanks.

10 Oct 2007 Gaussian Convolution Filter Filter to introduce spatial autocorrelation while keeping original distribution. Author: Felix Hebeler Hebeler, Felix

Mean and standard deviation of a distribution will only be kept if the mean is 0! If you need a different mean, add it after filtering... (Thanks Gary!)

01 Aug 2007 Modal Calculates statistical mode and returns indices Author: Felix Hebeler Hebeler, Felix

True, took this out of a script and didn't think about it. Thanks for the feedback, I kicked the reshape part out. It's even more than 30% faster in some cases now..

31 Jul 2007 Modal Calculates statistical mode and returns indices Author: Felix Hebeler Miller, Scott

Felix

[m,in] = mode(A(:));

works for N dimensional matrices and with NaN, although the one-liner is much slower (there is a lot of general error checking overhead in mode) and doesn't return the number of hits. It also returns the first element found in index form, not subscript form.

If you use the A(:) trick in your code rather than reshape, modal runs 30% faster.

Scott

31 Jul 2007 Modal Calculates statistical mode and returns indices Author: Felix Hebeler Hebeler, Felix

Just to make this clear: the build in 'mode' command does the trick in Matlab, this function only also works for 2&3D matrices and also returns the indices of the modal elements. If there are more than one element with equal number of occurrances, the first one found will be returned.

20 Jun 2007 Moran's I Calculates local Moran's I index of spatial correlation for raster. Author: Felix Hebeler Lennard, Jay

Ok, but use of confilt or nlfilter would speed up things (would require imageprocessing toolbox)

15 May 2007 Hypsometric Integral Calculates the hypsometric integral for a raster and plot curve Author: Felix Hebeler saklani, rajendra

05 May 2007 Hillshade calculates a hillshade for a DEM (matrix) Author: Felix Hebeler Hebeler, Felix

Implemented the GRADIENT function - thanks for the suggestions and code, its much faster now...

03 May 2007 Hillshade calculates a hillshade for a DEM (matrix) Author: Felix Hebeler Stevens, Andrew

Well done! Easy to use, good comments and produced a nice result for me. Thanks.

One question: could something like the "gradient" function be used instead of nlfilt. That way, users wouldn't need the IP toolbox to implement.

21 Feb 2007 rsquare calculate rsquare from data y and estimate yhat Author: Felix Hebeler giovane, baldo

 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com