Time Scaling in MATLAB (Code + Output)

You can do Time Scaling in Matlab of Discrete as well as Continuous signals. To time scale any discrete or continuous signal in Matlab, simply open and create a new Script (.m file) in Matlab.


Step 1:

Open MATLAB << Then on the top left corner click on the File option << Click New << Then click Script.

 

 

Step 2:

Now write the following Matlab code given below of Time Scaling into the new script (.m file) and save the file in the Matlab directory with any name you want.


TIME SCALING MATLAB CODE:

x1 = [1 2 3 4 5 ]

a=length(x1);

n=0:1:a-1;

stem(x1);

xlabel(‘Number of samples’)

ylabel(‘Amplitude’)

title(‘Time Scaling’)

display(x1);



 Step 3:

Now Run the code, after you have saved the file.

 

 

OUTPUT:

FIDakANqAE1oAbUgBpQA2pADagBNaAG1ECxNfAPVWl6wk4SWFgAAAAASUVORK5CYII= - Time Scaling in MATLAB (Code + Output)

 

This is how you can Time Scale a signal in MATLAB. Hope you like this article. If you want to learn more about MATLAB you can read and view all the blog posts related to MALTAB here. MATLAB Learning

If you need any help and assistance, please comment down below so that we can help you. Good Luck!!