Re: Unevaluated values of a[[i]]+b[[j]]
- To: mathgroup at smc.vnet.net
- Subject: [mg65241] Re: [mg65211] Unevaluated values of a[[i]]+b[[j]]
- From: János <janos.lobb at yale.edu>
- Date: Tue, 21 Mar 2006 07:46:02 -0500 (EST)
- References: <200603181140.GAA09748@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
On Mar 18, 2006, at 6:40 AM, Alexandre Costa wrote:
> Dear group,
> Suppose a have a = {3,4,4} and b = {4,3,8}.
> I want to see the Unevaluated numerics values of a[[i]]*b[[j]],
> a[[i]]+b[[j]], a[[i]]/b[[j]], a[[i]] - b[[j]].
>
> The NonCommutativeMultiply operator (**) solves the case of a[[i]]
> *b[[j]].
> But suppose I want to extend that NonCommutativeMultiply operator
> (**) to
> others operations: +, -, / , i.e., see the Unevaluated numeric
> values of
> a[[i]]+b[[j]], a[[i]]/b[[j]], a[[i]] - b[[j]]. Does anybody have a
> clue
> how to do this ?
>
> Suppose I have the expression for the roots of the quadratic
> equation: -
> b[[index]]^2 + Sqrt[delta]/2*a[[index]]
> How can I see at once all the numeric values unevaluated on that
> expression.
>
> In short words, I have lenghtly expressions(with
> sums,subtraction,divisions
> and multiplications and powers) and I want to check each numeric
> value of
> each term in the original unevaluated formula containing elements
> such as a[[index]] .
> I was thinking in a operator or function to solve all this issue.
> Any help is very welcome,
> Thanks,
> Alex
>
Here is a newbie approach for +. Similarly it can be done for the
other operators
In[1]:=
a = {3, 4, 4};
b = {4, 3, 8};
In[3]:=
as = ToString /@ a;
bs = ToString /@ b;
In[11]:=
as[[1]] + bs[[1]]
Out[11]=
"3" + "4"
When it comes to evaluation:
In[19]:=
ToExpression /@ (as[[1]] +
bs[[1]])
Out[19]=
7
János
- References:
- Unevaluated values of a[[i]]+b[[j]]
- From: "Alexandre Costa" <amscosta@uem.br>
- Unevaluated values of a[[i]]+b[[j]]