Multiple input values for same function and plot them?
60 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello,
I was wondering if there was a quick clean and easy way to make a function input multiple values of x, such as 0, .25 ,.5, .75, 1 and then plot these five curves out on the same plot. I know how to do it manualy by create 5 different functions and naming them slightly differently, but I was wondering if there was a quicker/cleaner way of doing it?
4 comentarios
Respuestas (1)
KSSV
el 28 de Nov. de 2019
A = [10 20 30 405 50] ;
th = linspace(0,2*pi) ;
X = zeros(length(A),length(th)) ;
for i = 1:length(A)
X(i,:) = A(i)*sin(th) ;
end
plot(th,X)
1 comentario
Ver también
Categorías
Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!