LavezLas
Newbie level 5
- Joined
- Apr 4, 2013
- Messages
- 8
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,337
Hi fellas,
I'm not familiar with MATLAB, and this year in our Introduction to DSP class, teacher gave us a homework but nearly none of us knows MATLAB much...
His question is;
Create an array with randomly-selected 1000 elements between -50 and 50. Compare
each element of the array such that;
If the element is greater than 30; change it as 30.
If the element is less than -30; change it as -30.
If the element is between -30 and 30; the element keeps its value.
Write the corresponding code for the question.
I'm not familiar with MATLAB, and this year in our Introduction to DSP class, teacher gave us a homework but nearly none of us knows MATLAB much...
His question is;
Create an array with randomly-selected 1000 elements between -50 and 50. Compare
each element of the array such that;
If the element is greater than 30; change it as 30.
If the element is less than -30; change it as -30.
If the element is between -30 and 30; the element keeps its value.
Write the corresponding code for the question.