Trying a overlapping but piecewise plot
Mostrar comentarios más antiguos
Here is my code:
clear all
close all
clc
syms a(x)
N1_0 = - (3*x^5)/16 + (5*x^3)/8 - (15*x)/16 + (1/2);
N2_0 = (3*x^5)/16 - (5*x^3)/8 + (15*x)/16 + 1/2;
N1_1 = - (3*x^5)/16 + x^4/16 + (5*x^3)/8 - (3*x^2)/8 - (7*x)/16 + 5/16;
N2_1 = - (3*x^5)/16 - x^4/16 + (5*x^3)/8 + (3*x^2)/8 - (7*x)/16 - 5/16;
N1_2 = - x^5/16 + x^4/16 + x^3/8 - x^2/8 - x/16 + 1/16;
N2_2 = x^5/16 + x^4/16 - x^3/8 - x^2/8 + x/16 + 1/16;
x1 = 0;
x2 = 0.25;
x3 = 0.5;
x4 = 0.75;
x5 = 1;
a(x) = piecewise(x1<=x<=x2,0,x4<=x<=x5,0,x3<=x<=x4,N1_0,x2<=x<=x3,N2_0,x2<=x<=x3,N1_1,x3<=x<=x4,N1_1,x2<=x<=x3,N2_0,x2<=x<=x3,N2_1,x3<=x<=x4,N2_2)
fplot(a)
The idea is to overlap N1_0 to N2_2 on to 0.5, without a residual solution, but the functions should overlap each other on the same plot/line
This is the pencil sketch of how it should look like:

Feel free to ask if you want to know anything about this
Using piecewise function was my idea (coz I thought it would work but it didn't) but it is not necessary.
Feel free to modify the code as you please
Using MATLAB online
Please help
Thanks
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Linear Algebra en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




