S
shapper
Hello,
I am converting a few Matlab functions to C#.
Each function has 2 to 8 inputs being 1 or 2 an array with 1xN
dimension.
All functions return 1 or 2 arrays.
What would be the best way, in terms of performance and usability, to
create these functions?
I see the following options:
1. Make each function a class with properties that are inputs.
Then a method Run that makes the calculation.
I am not sure if it is "to much" to create a class for each
function.
2. Create a class MatlabFunctions and inside have static methods for
each function with the inputs.
Which one would be the best way to implement it?
The calculation inside the functions differ a lot.
Some are quite simple ... others are a little bit more complex.
And some functions rely on other functions to for their own
calculations.
And are there better options than 1 and 2?
Thank You,
Miguel
I am converting a few Matlab functions to C#.
Each function has 2 to 8 inputs being 1 or 2 an array with 1xN
dimension.
All functions return 1 or 2 arrays.
What would be the best way, in terms of performance and usability, to
create these functions?
I see the following options:
1. Make each function a class with properties that are inputs.
Then a method Run that makes the calculation.
I am not sure if it is "to much" to create a class for each
function.
2. Create a class MatlabFunctions and inside have static methods for
each function with the inputs.
Which one would be the best way to implement it?
The calculation inside the functions differ a lot.
Some are quite simple ... others are a little bit more complex.
And some functions rely on other functions to for their own
calculations.
And are there better options than 1 and 2?
Thank You,
Miguel