Basic Codes For Matlab: 'Sine Wave' 'Time' 'Amplitude'
Basic Codes For Matlab: 'Sine Wave' 'Time' 'Amplitude'
% ones of 4 x4
y = ones(4)
% zeros
% 1 row : 10 column
i = zeros(1,10)
% eye
% diagonal elements 1
i = eye(5)
% inverted eye % diagonal elements 0
i = ~eye(5)
% random numbers generation 5 x 5
i = rand(5)
% Size Command
y = size(t)
% Length Command
y = length(t)
y = 7 + 6j
% Conjugate
k = conj(y)
%Generate the random matrix of 1x10 and check if any number is greater or
%equal to 0.5 make it 1
a= rand(1,10);
for m=1:10;
if a(1,m)>=0.5;
a(1,m)=1;
end
end
Important points
function dsp()
clc;
figure (10);
pcode dsp.m
mcc -m dsp.m