Plot a function which contains a variable parameter
8 views (last 30 days)
assuming to have a function like that:
where b is a variable parameter [b(1)=0,b(2)=3,b(3)=7...]. How can I plot f for each values of b, in a certain time range, using a for loop?
Thank you very much
KSSV on 18 Jun 2021
It is your home work....read about for loop and aray indexing in MATLAB. Given eblow a demo example. Extend this to your case.
a = [1 2 3] ;
th = linspace(0,2*pi) ;
X = zeros(length(a),length(th)) ;
for i = 1:length(a)
X(i,:) = a(i)*sin(th) ;