Thread Subject: min function

Subject: min function

From: munir

Date: 8 Nov, 2009 11:34:17

Message: 1 of 2

dear all,
i m doing following program but it is not working.
where kuufinal and muufinal are mass matrix.
h=[zeros(1,g)]
for i=1:1:g
    x=kuufinal(i,i)/muufinal(i,i)
    x=[zeros(1,(i-1)),x,zeros(1,(g-i))]
    h=h+x
end
H=h
x1=[ones(g,1),zeros(g,(q-1))];
for j=1:1:(q-1)
[c,i]=min(H)
H(i)=inf;
v=[zeros((i-1),1);1;zeros((g-i),1)];
x=[zeros(g,1),zeros(g,(j-1)),v,zeros(g,(g-j))];
x1=x1+x;
end

following error is coming.
??? Undefined function or method 'min' for input arguments of type
'sym'.

Error in ==> Untitled17 at 371
[c,i]=min(H)

plz help to correct.
thanks and regards.

Subject: min function

From: Steven Lord

Date: 8 Nov, 2009 23:02:21

Message: 2 of 2


"munir" <munirpansare@gmail.com> wrote in message
news:5f4e03da-0f98-4ac1-baa1-de5a8b126755@z4g2000prh.googlegroups.com...
> dear all,
> i m doing following program but it is not working.
> where kuufinal and muufinal are mass matrix.

*snip*

> following error is coming.
> ??? Undefined function or method 'min' for input arguments of type
> 'sym'.
>
> Error in ==> Untitled17 at 371
> [c,i]=min(H)
>
> plz help to correct.
> thanks and regards.

You cannot use the MIN function on symbolic arrays. One reason for this:
what is the minimum value of [sym('x'), sym('y')]? You will need to convert
the symbolic expression into a numeric array (using the DOUBLE function) in
order to use the MIN function.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread
 

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