plot with input arguments

9 visualizaciones (últimos 30 días)
Roger Nadal
Roger Nadal el 5 de Dic. de 2019
Comentada: Roger Nadal el 11 de Dic. de 2019
i want to subplot 4 string containg cell array from ( sin, cos, tan,sinh) and vector (+,o,*,x,s) and the mathmatical function should be ploted in interval (-2pi,2pi)with step 0.3

Respuesta aceptada

Walter Roberson
Walter Roberson el 5 de Dic. de 2019
funs_cell = {'sin', 'cos', 'tan', 'sinh'};
markers = {'+', 'o', '*', 'x', 's'};
funs = cellfun(@str2fun, funs_cell, 'uniform', 0);
for K = 1 : length(funs)
plot(x, funs{K}(x), markers{K}, 'DisplayName', funs_cell{K});
hold on
end
  33 comentarios
Roger Nadal
Roger Nadal el 11 de Dic. de 2019
Thank you
Roger Nadal
Roger Nadal el 11 de Dic. de 2019
If I don’t want to generate random order for then should I remove randperm?

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by