for example, x=[1:1:9] and I want y=x*2 for x=1,2,3, y=x+2 for x=4,5,6 and y=x*3 for x=7,8,9 so the result is y=[2,4,6,6,7,8,21,24,27]. Can anyone help me to write the correct code for this case? Thank you
MATLAB: How to use conditional statement for this case
if statementwhile loop
Related Question
- Neighbor searching
- Is this a switchyarding case
- Help running Matlab script
- How to reshape the x-axis in this case
- How to fill the area between these two curves? I tried using fill function along with the flipud and fliplr function but the problem is both the curves have different x and y value.s.
- How can make code to present this following case
- How to fit a series of datapoints using 3 piecewise linear fit lines
Best Answer