Equation of a straight line, how to create an equation with two matrices?
Show older comments
I am a newbie in Matlab I know it will sound silly to most of you guys but I could not solve an example about creating a straight line with the:
x=10, y=1 and x will decrease up to 0, y will increase up to 10. I tried to do something like this:
A=[10,9,8,7,6,5,4,3,2,1];
x=A; B=1:10;
y=B;
for n=1:10 m=y(n)/x(n); plot(x,m*x-(x-x(n))) xlim([0 10]) ylim([0 10])
pause(2)
end
I used pause to see every change in the graph yet the output is something quite different from what I was expecting.
Any suggestions? Again I am a newbie sorry if it is too easy :)
Waiting for answers...Thanks Okan..
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!