Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15433 > unrolled thread

ReplacePart

Started byman21 <man21@free.fr>
First post2013-09-14 10:00 +0000
Last post2013-09-15 11:02 +0000
Articles 3 — 3 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  ReplacePart man21 <man21@free.fr> - 2013-09-14 10:00 +0000
    Re: ReplacePart "Dr. Wolfgang Hintze" <weh@snafu.de> - 2013-09-15 10:59 +0000
    Re: ReplacePart "Nasser M. Abbasi" <nma@12000.org> - 2013-09-15 11:02 +0000

#15433 — ReplacePart

Fromman21 <man21@free.fr>
Date2013-09-14 10:00 +0000
SubjectReplacePart
Message-ID<l11c49$ivr$1@smc.vnet.net>
Hello,

As a result of a calculation, I end up with a list of numerical values 
which contains  some "Indeterminate".

x ={-1.25664, 0.628319, -0.628319, 1.25664, Indeterminate, -1.25664,
0.628319, -0.628319, 1.25664, Indeterminate}

I try to replace the "Indeterminate" by "0", using :

ReplacePart[x, {5, 10} -> 0.]

but this dosen't work. Any idea why, and how to do it ?

Thanks,

Michel

[toc] | [next] | [standalone]


#15445

From"Dr. Wolfgang Hintze" <weh@snafu.de>
Date2013-09-15 10:59 +0000
Message-ID<l143v9$pr9$1@smc.vnet.net>
In reply to#15433
Am Samstag, 14. September 2013 12:00:41 UTC+2 schrieb man21:
> Hello,
> 
> 
> 
> As a result of a calculation, I end up with a list of numerical values 
> 
> which contains  some "Indeterminate".
> 
> 
> 
> x ={-1.25664, 0.628319, -0.628319, 1.25664, Indeterminate, -1.25664,
> 
> 0.628319, -0.628319, 1.25664, Indeterminate}
> 
> 
> 
> I try to replace the "Indeterminate" by "0", using :
> 
> 
> 
> ReplacePart[x, {5, 10} -> 0.]
> 
> 
> 
> but this dosen't work. Any idea why, and how to do it ?
> 
> 
> 
> Thanks,
> 
> 
> 
> Michel

You can do it with simple replacement rule:

x /. Indeterminate -> 0

Regards,
Wolfgang

[toc] | [prev] | [next] | [standalone]


#15450

From"Nasser M. Abbasi" <nma@12000.org>
Date2013-09-15 11:02 +0000
Message-ID<l1444i$psf$1@smc.vnet.net>
In reply to#15433
On 9/14/2013 5:00 AM, man21 wrote:
> Hello,
>
> As a result of a calculation, I end up with a list of numerical values
> which contains  some "Indeterminate".
>
> x ={-1.25664, 0.628319, -0.628319, 1.25664, Indeterminate, -1.25664,
> 0.628319, -0.628319, 1.25664, Indeterminate}
>
> I try to replace the "Indeterminate" by "0", using :
>
> ReplacePart[x, {5, 10} -> 0.]
>
> but this dosen't work. Any idea why, and how to do it ?
>

Need to use this syntax:

ReplacePart[x, {{5}, {10}} -> 0.]

--Nasser

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web