Borrar filtros
Borrar filtros

function of the following

1 visualización (últimos 30 días)
ivko ivkovic
ivko ivkovic el 20 de Feb. de 2022
Editada: ivko ivkovic el 1 de Mzo. de 2022
function:
time constants :

Respuesta aceptada

Image Analyst
Image Analyst el 20 de Feb. de 2022
Try this:
tau = [1, 0.5, 0.1];
for k = 1 : length(tau)
t = linspace(0, 5 * tau(k), 1000);
f = exp(-t / tau(k));
subplot(3, 1, k);
plot(t, f, 'b-', 'LineWidth', 2);
caption = sprintf('Tau = %.1f', tau(k));
title(caption);
grid on;
xlabel('t');
ylabel('f');
end
  2 comentarios
ivko ivkovic
ivko ivkovic el 20 de Feb. de 2022
thanks is it possible to edit the script so all plots should appear in the same window and be of different styles?
thanks a lot
Image Analyst
Image Analyst el 20 de Feb. de 2022
tau = [1, 0.5, 0.1];
for k = 1 : length(tau)
t = linspace(0, 5 * tau(k), 1000);
f = exp(-t / tau(k));
plot(t, f, '-', 'LineWidth', 4);
hold on;
caption = sprintf('f vs t');
title(caption, 'FontSize', 20);
grid on;
xlabel('t', 'FontSize', 20);
ylabel('f', 'FontSize', 20);
end

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by