Matlab - codigo de matlab a python me complica

 
Vista:
sin imagen de perfil

codigo de matlab a python me complica

Publicado por areba (1 intervención) el 24/11/2022 19:21:08
Quisiera pasar este codigo de matlab a python pero no se mucho sobre matlab

title("ejercicio 3");
%Ejercicio 3 Invarianza en el tiempo
clear all; clc; close all;
t0=2; %Fctor de desplazamiento o de escalamiento
t1=-10:0.01:10; %tiempo original
t2=t1*t0; %tiempo expandido: t->t0 t
t3=t1+t0; %tiempo retrasado: t->t-t0
t4=(t1+t0)*t0; %tiempo retrasado y expandido t->t0(t-t0)
t5=t1*t0+t0; %tiempo expandido y retrasado t-> t0 t-t0
x1=(t1<=2).*(t1>=-2); %señal original: pulso cuadrado
y1=x1;
x2=x1;
y2=x1;
subplot(3,2,1); plot (t1,x1); grid on;
ylabel("x1(t)"); xlabel("t"); axis([-4.2 8.2 -0.1 1.1]);
subplot(3,2,2); plot (t2,y1); grid on;
ylabel("y1(t)"); xlabel("t"); axis([-4.2 8.2 -9.1 1.1]);
subplot(3,2,3); plot (t3,x2); grid on;
ylabel("x2(t)=x1(t-2)"); xlabel("t"); axis([-4.2 8.2 -0.1 1.1]);
subplot(3,2,4); plot (t4,y2); grid on;
ylabel("y2(t)"); xlabel("t"); axis([-4.2 8.2 -0.1 1.1]);
subplot(3,2,6); plot (t5,y1); grid on;
ylabel("y1(t-2)"); xlabel("t"); axis([-4.2 8.2 -9.1 1.1]);
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder