Posts

Showing posts from June, 2025

Matlab Basics

🌐 Web Design | Development | YouTube Content Creation 📞 Contact: 9994905524 🚀 Learn Cloud Computing: www.aicloudcomputing.blogspot.com Matlab code to generate Sin Wave: clc; clear; close all ; % Define x from 0 to 2*pi with step size 0.01 x = 0:0.01:10*pi; % Compute y = sin(x) y = sin(x); % Plot the sine wave plot(x, y, 'r-' , 'LineWidth' , 2); grid on ; % Add labels and title xlabel( 'x (radians)' ); ylabel( 'sin(x)' ); title( 'Sine Waveform without linspace' ); Matlab code to generate Sin Wave and Cosine Wave: clc; clear; close all ; % Define step size step = 0.01; % Define x for sine wave from 0 to 2*pi x1 = 0:step:2*pi; y1 = sin(x1); % Define x for cosine wave starting right after sine ends % So it continues from 2*pi to 4*pi x2 = (2*pi + step):step:(4*pi); y2 = cos(x2); % Combine the x and y vectors x = [x1, x2]; y = [y1, y2]; % Plot the combined wave plot(x, y, 'r-' , 'LineWidth' , 2); grid on ; xlabel( 'x (radian...