y = ((x.^2)-((3(x))+7))./(sqrt((2(x))+5));
this is the one that I am working with but it is not working it keeps on telling me that it needs additional parenthesis but even though i added it still wont work. Its almost working just this one.
x=-1:0.1:5;
y = ((x.^2)-((3(x))+7))./(sqrt((2(x))+5));
plot(x,y);
title('Graph of f(x)=((x.^2)-((3(x))+7))./(sqrt((2(x))+5)) for x=[-1:5]');
xlabel('x');
ylabel('f(x)');
here is my full program and i've used the same with the other just different y and it works with the others.

 Accepted Answer

It actually needed two multiplication operators, then the parenthesis problem was easy to solve.
See if this does what you want it to do:
y = ((x.^2)-(3*x)+7)./(sqrt(2*x)+5);
.

4 Comments

ohhh, i thought it will automatically read 3(x). I really need to put the * everytime I multiply right?
Yes!
MATLAB does not recognise implicit multiplication, so use either * or .* depending on what you want to do.
Thank you so much for making it clear to me, im new to matlab
As always, my pleasure!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!