Hello, I am new to programming
Can you please help me make code on C# for the equation on the attachment.! any help will be greatly appreciated.
Thank you in advance.
Printable View
Hello, I am new to programming
Can you please help me make code on C# for the equation on the attachment.! any help will be greatly appreciated.
Thank you in advance.
That's nice, why not go to rentacoder.com.
If you understand that equation, you are way ahead of the game on most of us (I presume, sorry if there are more of you out there that do infact understand it, kudos if you do!). Look up aritcles on c# math library, besides that, just know it uses ( ) to help order mathmatical operations, * = times, / = divide, + = plus, - = minus, ^ = power of ... think thats about all i can provide.
Thanks a lot guys for your input.
Well i could do with just a simple general solution for coding a summation notation.
sorry for the complex equation.!!
thanks again!!
You don't have to apologize for the complex formula... if you understand what a summation notation is, you could just describe how you figure it out in english, then maybe I (or somebody else here) could translate what it would take in C#.
All I could find on 'summation' google wise were things similar to just summing sequential set of values, like...
Code:/*
C#: The Complete Reference
by Herbert Schildt
Publisher: Osborne/McGraw-Hill (March 8, 2002)
ISBN: 0072134852
*/
// Use byte.
using System;
public class Use_byte {
public static void Main() {
byte x;
int sum;
sum = 0;
for(x = 1; x <= 100; x++)
sum = sum + x;
Console.WriteLine("Summation of 100 is " + sum);
}
}
Thanks..!!
I want to get a value at every iteration,
e.g. if the loop runs for 10 times, i want to get the resultant then add it to a constant
so at every iteration, the program will return (loop value + constant)
The code is for least squares method, curve fitting