How plot 2d of more than 3 function and substitute the number in each function separate parameter?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
salim
el 7 de Feb. de 2025
Comentada: salim
el 8 de Feb. de 2025
How i can plot 2D of thus function and in each function susbtitute the value m seperatly with different color ? like this example

y1=real(((-0.385e1 * tanh(-x - 0.310e1) - 0.385e1 * coth(-x - 0.310e1)) ^ (0.1e1 / m / 0.2e1)) * exp(i * (0.431e1 * t - 0.282e1)));
y2=real(((-0.385e1 * tanh(-x - 0.310e1) - 0.385e1 * coth(-x - 0.310e1)) ^ (0.1e1 / m / 0.2e1)) * exp(i * (0.431e1 * t - 0.282e1)));
y3=real(((-0.385e1 * tanh(-x - 0.310e1) - 0.385e1 * coth(-x - 0.310e1)) ^ (0.1e1 / m / 0.2e1)) * exp(i * (0.431e1 * t - 0.282e1)));
y4=real(((-0.385e1 * tanh(-x - 0.310e1) - 0.385e1 * coth(-x - 0.310e1)) ^ (0.1e1 / m / 0.2e1)) * exp(i * (0.431e1 * t - 0.282e1)));
y5=real(((-0.385e1 * tanh(-x - 0.310e1) - 0.385e1 * coth(-x - 0.310e1)) ^ (0.1e1 / m / 0.2e1)) * exp(i * (0.431e1 * t - 0.282e1)));
5 comentarios
Respuesta aceptada
Torsten
el 7 de Feb. de 2025
y=@(x,t,m)real(((-0.385e1 .* tanh(-x - 0.310e1) - 0.385e1 * coth(-x - 0.310e1)) .^ (0.1e1 ./ m ./ 0.2e1)) .* exp(i * (0.431e1 * t - 0.282e1)));
x = (0:0.1:2).';
t = 1;
m = 0.5:0.5:3;
plot(x,y(x,t,m))
xlabel('x')
ylabel('y')
legend('m=0.5','m=1','m=1.5','m=2','m=2.5','m=3')
2 comentarios
Torsten
el 7 de Feb. de 2025
All the plot options are listed in the section "Input Arguments" under
Read about "LineSpec" and "LineWidth".
Más respuestas (0)
Ver también
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!