Code Comments
Programming Forum and web based access to our favorite programming groups.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
Post Follow-up to this messageMichael 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.
Post Follow-up to this messageI 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
Post Follow-up to this messageMichael: <SNIP what's real - what's wrong... ...with % loop res(ii)=result(real(result)==result) % loop us
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.