writing out a quadratic
16 views (last 30 days)
Show older comments
My x value is -2:0.001:1.7 and my y value is supposed to be y=32-4x^2.3+7sqrt(x). Whenever I try to write out the y-value I keep on getting a syntax error and i am not sure how to fix.
Please help.
0 Comments
Answers (1)
James Tursa
on 8 Feb 2021
Edited: James Tursa
on 8 Feb 2021
Use the element-wise operators that include the "dot" (such as .^ instead of just ^), and use the multiply operator * between the constants and the variables:
x = -2:0.001:1.7;
y = 32 - 4*x.^2.3 + 7*sqrt(x);
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!