how can i find the x Value
3 views (last 30 days)
Show older comments
I have this three line code, how can i define "x" value
part1 = @(x) (x >= 5).*(10*sqrt(x) + 25);
part2 = @(x) (x >= 0 & x <= 4).*(10*x + 25);
part3 = @(x) (x < 2) .*25;
0 Comments
Answers (1)
Star Strider
on 5 Oct 2021
x = linspace(-25, 25, 250);
part1 = @(x) (x >= 5).*(10*sqrt(x) + 25);
part2 = @(x) (x >= 0 & x <= 4).*(10*x + 25);
part3 = @(x) (x < 2) .*25;
figure
plot(x, part1(x))
hold on
plot(x, part2(x))
plot(x, part3(x))
hold off
grid
legend('part1','part2','part3', 'Location','best')
.
0 Comments
See Also
Categories
Find more on Collect Coverage for Models 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!