how to convert from functions to matrix?
16 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
kisik KIM
el 11 de Sept. de 2020
Editada: Ameer Hamza
el 11 de Sept. de 2020
I hope to make matrix about functions such as y=sinx
In other words, y=sinx functions' graph will be corresponded to m x n matrix.
For example, when I have a 300 x 200 matrix with a origin of (150,1), I want to call the value of the path through which the sin function passes in this matrix one.
how to do it?
Thanks
3 comentarios
Respuesta aceptada
Ameer Hamza
el 11 de Sept. de 2020
Editada: Ameer Hamza
el 11 de Sept. de 2020
Are you trying to do something like this
M = zeros(300, 500);
cols = 1:size(M,2);
rows = floor(150-100*sin(cols/10));
idx = sub2ind(size(M), rows, cols);
M(idx) = 1;
imshow(M)
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Graph and Network Algorithms 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!