File Exchange

image thumbnail

R2 calculator

version (1012 Bytes) by Joris Meurs
Function for direct calculation of the coefficient of determination of two vectors


Updated 28 Mar 2016

View License

Filname: 'rsquare.m'. This file can be used for directly calculating
the coefficient of determination (R2) of a dataset.
Two input arguments: 'X' and 'Y'
One output argument: 'R2'

X: Vector of x-parameter
Y: Vector of y-paramter
R2: Coefficient of determination

Input syntax: rsquare(X,Y)

Developed by Joris Meurs BASc (2016)

Cite As

Joris Meurs (2021). R2 calculator (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

June Marquiss

I was trying to follow instructions to get rsquared in matlab and couldn't figure it out. This worked perfectly & checked with the data that we did in excel

Kaitlyn Ingalls

MATLAB Release Compatibility
Created with R2014a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!