Hello all,
I am pretty new to microcontroller programming. I have a simple question if the planned workflow is doable without expert skills. Excuse me for the newbee questions 
I want to achieve the following workflow.
I want to read sensor data of a linear movement from a potentiometer and with a frequency of 100Hz. The sensor shall measure for 1 sec, therefore I will get of course 100 data points.
These data shall be stored to the EEPROM. (I imagine this is achievable with a simulink model.) In the next step (starts as soon as all 100 data points are stored to the memore) I want to evaluate this data with an algorithm I developed a matlab function for and output the results (will be an integer).
Is the described workflow doable within one simulink model? E.g. having a matlab function block that is triggered after sensor data was collected for one sec?
Some food for thoughts is very welcome. 
Regards!
Is this an Arduino question or a Matlab question ?
Kind of both..
I want to develop the code to store the measurement data into the EEPROM until 100 points are collected and afterwards read it and evaluate the whole array with a existing algorithm..
Since I have no experience in code gen. with simulink I want to know if this workflow is achievable within a simulink model that I can download to the arduino uno.
Thank you.
The Arduino can certainly do what you want, ie collect a number of samples and periodically send them to another device, usually via a Serial interface. Depending on the number and frequency of samples it may not be wise to store the values in the EEPROM because it has a limited number of write cycles guaranteed. You could, however, store the values in an array subject to there being enough memory.
However, whether simulink can do what you want I do not know. If you have to learn how to use simulink then you may as well learn how to program the Arduino directly.
UKHeliBob:
However, whether simulink can do what you want I do not know. If you have to learn how to use simulink then you may as well learn how to program the Arduino directly.
He apparently knows how to program in Matlab, because Simulink is a firmware that is downloaded to the Arduino so Matlab can work with the Arduino.
It is much like LINX for LabVIEW.
It only makes sense to do something like this if one is only familiar with Matlab and cannot be bothered to learn C++.
Thank you for your answers.
Yea I know how to program this workflow in matlab (I cannot program in C).
I am also familiar with simulink, but not with code gen by matlab coder or via simulink.
I know about the arduino lib for simulink but as you said using a serial interface to store the data to the memory, I dunno yet how to model this properly in simulink.
I just wanted to know if my workflow could be handled by the arduino one, because I do not know how to program the arduino to store the input values from the sensor. (I think I will need a simulink S function here). I wanted to clearify this before I spend much effort in trying to model my workflow.
If you have any advices how I can realize this "store sensor input as array to memory" in simulink I am very thankful for some hints.
Regards!
Fargulli:
Thank you for your answers.
Yea I know how to program this workflow in matlab (I cannot program in C).
I am also familiar with simulink, but not with code gen by matlab coder or via simulink.
I know about the arduino lib for simulink but as you said using a serial interface to store the data to the memory, I dunno yet how to model this properly in simulink.
I just wanted to know if my workflow could be handled by the arduino one, because I do not know how to program the arduino to store the input values from the sensor. (I think I will need a simulink S function here). I wanted to clearify this before I spend much effort in trying to model my workflow.
If you have any advices how I can realize this "store sensor input as array to memory" in simulink I am very thankful for some hints.
Regards!
Since you insist on learning Simulink, then you are on your own.
Everything you want to know about Simulink and Arduino. http://www.mathworks.com/hardware-support/arduino-simulink.html
Take some Simulink tutorials. Learn with MATLAB and Simulink Tutorials - MATLAB & Simulink
Go forth and learn.
You could, however, store the values in an array subject to there being enough memory
I just tried programming a moving average filter with 100 points using an Uno. It didn't have enough memory. You may be able to do it with a mega.
Henradrie:
I just tried programming a moving average filter with 100 points using an Uno. It didn't have enough memory. You may be able to do it with a mega.
He's using another software product to program the Uno.