for a constant w=2 a matrix is to be generated by incrementing it as many times and save it in another matrix as the following way out=[w+1 w+2 w+3 w+4.......]
Direct link to this comment:
Please post what you have tried so far and which problems occurred.
No products are associated with this question.
Direct link to this answer:
w = 2;
N = 10; % N value may be anything as the length u need..
for i = 1 : N
Please do not answer homework questions.
A pre-allocation would be more efficient. Otherwise "out" grows in each iteration, which wastes a lot of time - for larger arrays.
MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Opportunities for recent engineering grads.
New to MATLAB?
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Choose your country to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a location from the following list:
See all countries