Azzera filtri
Azzera filtri

plot with input arguments

1 visualizzazione (ultimi 30 giorni)
Roger Nadal
Roger Nadal il 5 Dic 2019
Commentato: Roger Nadal il 11 Dic 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

Risposta accettata

Walter Roberson
Walter Roberson il 5 Dic 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 Commenti
Roger Nadal
Roger Nadal il 11 Dic 2019
Thank you
Roger Nadal
Roger Nadal il 11 Dic 2019
If I don’t want to generate random order for then should I remove randperm?

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by