How can I access the first value from
object t = (object) wsf.LinEst(y.ToArray(), x.ToArray(), false, true);
The output is
object[1..5, 1..2]}
[1, 1]: 0.17134831460674155
[1, 2]: 0.0
[2, 1]: 0.019612696690686725
[2, 2]: -2146826246
[3, 1]: 0.95020429009193053
[3, 2]: 0.82746057986828336
[4, 1]: 76.328205128205056
[4, 2]: 4.0
[5, 1]: 52.261235955056179
[5, 2]: 2.7387640449438226
I need to get only [1,1] ‘s value i.e. 0.17134831460674155
How to get that.
The linEst return an object only.
I am using C#3.0
Thanks
Thanks
Well, it looks like it’s something you can enumerate which returns doubles – although it may not actually implement
IEnumerable<double>. Try this (with ausing System.Linq;directive at the top of your code):However, that won’t work if actually it’s returning something like an
int[][]. Could you tell us more about what it’s really returning? Yes, it’s declared to just returnobject, but it’s clearly returning something more than that. If you know it will always return anobject[,]with 1-based indexes, you could cast to that:If you don’t know the lower bounds of the array, you can ask for them programmatically of course… but the LINQ way will probably be simpler.