1.0

1.0 | 1 rating Rate this file 3 Downloads (last 30 days) File Size: 1.19 KB File ID: #25517

Normalize Array Row Wise

by Shivani Rao

 

07 Oct 2009

Each array is normalized such that rows sum to 1

| Watch this File

File Information
Description

No error checking
a very basic function easy to understand

Given an array X of size [m,n]
output is an array of size [m,n]
the rows of the output array sum to 1

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
07 Oct 2009 Anon

could be solved more efficiently by calling bsxfun...

A = magic(4);
An = bsxfun(@rdivide,A,sum(A,2));

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
data export Shivani Rao 07 Oct 2009 10:37:21
data import Shivani Rao 07 Oct 2009 10:37:21
mathematics Shivani Rao 07 Oct 2009 10:37:21

Contact us at files@mathworks.com