Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Extracting Real number only from 6 roots
I am trying to extract only the real number from a set of roots. I
dont want the real parts of a complex number. Just the one valid time
value.

I tried help real but that is for complex numbers. Any ideas.

my mfile

t = 0:0.1:100;
velc = -0.907802*t + 88.000000;
velc = velc';


for ii = 1:1001

velc =velc(ii);
ply = [-0.000393 0.012873 -0.159027 0.875055 -2.195467 -2.899670
(88.000000-velc(ii))]

result = roots(ply)
result(ii) = real(result)

end

Report this thread to moderator Post Follow-up to this message
Old Post
Michael
04-28-05 02:01 AM


Re: Extracting Real number only from 6 roots
Michael wrote:
>
>
> I am trying to extract only the real number from a set of roots. I
> dont want the real parts of a complex number.

I think you want the "isreal" command rather than the "real" command.

Report this thread to moderator Post Follow-up to this message
Old Post
the cyclist
04-28-05 02:01 AM


Re: Extracting Real number only from 6 roots
I believe the isreal command only tells the make up of the number. I
cant use the real command in my mfile and only have it shown for
demonstrative purposes. I need a command to pull out the sole real
number and not any real part of a complex number. Thanks

Report this thread to moderator Post Follow-up to this message
Old Post
Michael
04-28-05 02:01 AM


Re: Extracting Real number only from 6 roots
Michael:
<SNIP what's real - what's wrong...

...with

% loop
res(ii)=result(real(result)==result)
% loop

us

Report this thread to moderator Post Follow-up to this message
Old Post
us
04-28-05 02:01 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Matlab archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:33 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.