Hey everyone,(adsbygoogle = window.adsbygoogle || []).push({});

I just started, what is supposed to be a beginners course in MatLab, but I am the only one who has never used MatLab before! I'm stuck on the very first HW assignment (although I did manage to get to problem 6 out of 7) and was hoping someone could explain why I keep getting an error message.

The question reads:

Make one 2D plot for 0≤x≤1 containing the following 6 functions

f(x) = x

g(x) = r x (1-x)

with r={0.5, 1.5, 2.5, 3.5, and 4}. Label the axes, choose very different line styles for each curve, and add a legend for each curve. Please insert the resulting graph here. For what values of r do f(x) and g(x) intersect?

Here is what I was trying to do:

>> x=0:0.1:1

>> r=[0.5 1.5 2.5 3.5 4]

>>y1=x

>>y2=r*x*(1-x)

--> This is where I get an error! What am I doing wrong? How do I get around this?

Thank you!!!

**Physics Forums - The Fusion of Science and Community**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab 2D plotting error help please

Have something to add?

Draft saved
Draft deleted

Loading...

Similar Threads - plotting error help | Date |
---|---|

Mathematica Errors when plotting but not when evaluating | Tuesday at 12:12 PM |

Using Maxima to plot error in Fourier series | Nov 5, 2017 |

Matlab Persistent plot legend error in recent install of R2015b | Jul 14, 2016 |

How to make thick line error bar for plot | Apr 1, 2016 |

Maple - Error (in plots:-display) | Oct 1, 2013 |

**Physics Forums - The Fusion of Science and Community**