No BSD License  

Highlights from
Multiplication of Linear Expressions

4.5

4.5 | 2 ratings Rate this file 2 Downloads (last 30 days) File Size: 1.19 KB File ID: #7406
image thumbnail

Multiplication of Linear Expressions

by Muhammad Rafiullah Arain

 

11 Apr 2005 (Updated 12 Apr 2005)

Multiplication of linear expressions.

| Watch this File

File Information
Description

Script for the multiplication of linear expressions without coefficient constants. This script returns a polynomial of given expressions.
The number of expressions are not restricted and constant may be real or integer.

Example

Compute the (x-2)(x+4)(x-5)...
write in following format. here x is a Row Matrix

>> x=[-2,4,5]
>> mul_l_exp(x)

MATLAB release MATLAB 5.3.1 (R11.1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
13 Apr 2005 Jos j

% This will do something very similar, but more efficient:
x = [-2, 4 5] ;
x = [ones(length(x),1) x(:)] ;
i = 1 ;
p = x(i,:) ;
while (i < size(x,1)),
  i = i + 1 ;
  p = conv(p,x(i,:)) ;
end
% p contains the coefficients
pstr = poly2str(p,'X') ;

furthermore, it can be easily changed for multiplying higher order polynomials.

23 Sep 2005 Nadeem Malik

good work. there is a need of multiple product methods

04 Oct 2005 Ali Amir

oooh, u solve my little problem

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
linear algebra Muhammad Rafiullah Arain 22 Oct 2008 07:45:31
multiplication of linear expressions Muhammad Rafiullah Arain 22 Oct 2008 07:45:31
polynomial Muhammad Rafiullah Arain 22 Oct 2008 07:45:31
mathematics Muhammad Rafiullah Arain 22 Oct 2008 07:45:31

Contact us at files@mathworks.com