- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We need to generate some complex math curves. Inotherwords. . . in normal ansi c, one can, for example, just say a=1:.1:5 and then say b=exp(a). I don't know how to do that in PSOC's code section. This can't be that difficult. I can write this in matlab in an instant.
The eventual goal is to generate an error curve, which is a type of sigmoid curve. This also involves dividing two math functions, in an element by element fashion. This is easily done in normal C code by saying: result=array1 (with a dot after it), division sign, and then array 2
Anybody out there got any experience doing these sort of things ?
Thanks. Bob
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I must admit that I have never seen the ability to declare a range like, or use arrays/ranges as arguments and return values to 'standard' functions that in 'ansi c' - python (especially numpy) yes; matlab/octave yes. And porting those languages to an embedded system might be possible but is it worth it? (Or am I just showing my ignorance of teh capabilities of whatever PSoC device you are using?)
The same goes for your description of array division.
The 'normal c' way of doing this is using a for loop and iterating over the elements of both arrays.
Can you provide a reference to the ANSI C Standard where this is done?
Also which PSoC device are you targeting? I would think you need to go for one with a floating point processor in built. Even then, transcendental functions can be relatively slow if you are not careful, especially when you are trying to apply them to large(ish) arrays.
Susan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I must admit that I have never seen the ability to declare a range like, or use arrays/ranges as arguments and return values to 'standard' functions that in 'ansi c' - python (especially numpy) yes; matlab/octave yes. And porting those languages to an embedded system might be possible but is it worth it? (Or am I just showing my ignorance of teh capabilities of whatever PSoC device you are using?)
The same goes for your description of array division.
The 'normal c' way of doing this is using a for loop and iterating over the elements of both arrays.
Can you provide a reference to the ANSI C Standard where this is done?
Also which PSoC device are you targeting? I would think you need to go for one with a floating point processor in built. Even then, transcendental functions can be relatively slow if you are not careful, especially when you are trying to apply them to large(ish) arrays.
Susan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Adding to SuMa_296631's response, it would be easier for us to provide a workaround for your request if you share the code. Can you please share the code that you want to implement in PSoC Creator?
Regards,
Rakshith M B
Rakshith M B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You might be interested to GNU Scientific Library.
https://www.gnu.org/software/gsl/doc/html/
Refer to the Vector and Matrices section.