Unfortunately, I have some what do you mean myself by your question, so please tolerate my attempt to answer at least some of your questions. The biggest question is what filter?
The first thing to know about Matlab is to avoid loops when you can because it runs faster if you can avoid the loop.
%% Most people like to initialize their work space
clc %this clears the command line
clear all %this clears all variables
close all %this closes all plots
%% a single percent sign % is a comment %% are a special comment that can be used to
% make pretty printed programs including literate programs
make_an_array=[5 10 15 20]; % I made an array name make_an_array
frequency=make_an_array; % arrays can be copied
%% using a loop to make sine waves
time=linspace(0,2,1024); %sine waves need time, actually angles
sine_by_vector_call=sin(2*pi*frequency(1)*time); %sine function is called sin
for i=1:length(time) % we don't call cos waves virtue waves
%% we can also make vector calls as vector calls
Out=zeros(length(frequency),length(time)); %Matlab likes you to preallocate memory
% It complains if you don't but
% it runs slower if you don't
% If Fortran like loops are your thing
% you can also do it best by
Out=sin(2*pi*frequency'*time); %make sur you say sin becouse sim gives you a strange error
% this works because
ft=frequency'*time; % is a matrix
whos % is a good debuging tool
I'll skip the max and filter part because I don't understand those parts of your question and the plot question also depends on it
you can copy the shaded stuff into your browser and in matlab say
and paste it into the editor that just opened
Maybe instructor was talking about the filter and max parts and someone snapchatted you. Isn't that so annoying, you think that what you pay for college, the instructor would stop.
When I was an undergrad, we didn't have Matlab. There was a program called APL that ran on IBM terminals but undergrads didn't get terminal accounts back then unless they really brown-nosed.
We didn't have internet or cell phones either. you would think it was very boring but we didn't have AIDS either, so it wasn't boring at all.