Let's say I want to graph f(x)=x on matlab with $\displaystyle x\in [0,10]$
How do you get matlab to graph the [0,1) part?
It always says "Attempted to access (0); index must be a positive integer or logical"
Let's say I want to graph f(x)=x on matlab with $\displaystyle x\in [0,10]$
How do you get matlab to graph the [0,1) part?
It always says "Attempted to access (0); index must be a positive integer or logical"
It seems you have set your interval up as an index of the variable, rather than an interval!
Try this:
x = 0:0.01:10;
y = f(x)
plot(x,y)
What this does is it sets x up as a vector which contains all the values from 0 to 10 in steps of 0.01.
Let's say I want to graph f(x)=x on matlab with $\displaystyle x\in [0,10]$
How do you get matlab to graph the [0,1) part?
It always says "Attempted to access (0); index must be a positive integer or logical"