3.0

3.0 | 1 rating Rate this file 0 Downloads (last 30 days) File Size: 16.93 KB File ID: #2330

Vectorized Safe Reciprocal

by Marc Compere

 

04 Sep 2002 (Updated 05 Sep 2002)

Accepts an input array and returns reciprocals of individual elements without divide-by-zero errors.

| Watch this File

File Information
Description

This block accepts an array of inputs and, depending on the individual elements, will return an array of reciprocals of the input.

If an input element is zero, the corresponding output element is assigned a very large number equal to 1/epsilon_machine on most 32-bit computers (epsilon_machine ~= 2.22044604925031e-016)

If the numebr is not zero, it returns the reciprocal of that number in the appropriate output element.

This function will give you the reciprocal of an array without producing divide-by-zero errors.

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
20 Jul 2010 FG

I am new to matlab; how do i use the files posted here?
thanks!

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
matrices Marc Compere 22 Oct 2008 06:51:15
avoid dividebyzero Marc Compere 22 Oct 2008 06:51:15
reciprocal Marc Compere 22 Oct 2008 06:51:15
utilities Marc Compere 22 Oct 2008 06:51:15
matrix manipulation Marc Compere 22 Oct 2008 06:51:15

Contact us at files@mathworks.com