plot with input arguments

1 view (last 30 days)
Roger Nadal
Roger Nadal on 5 Dec 2019
Commented: Roger Nadal on 11 Dec 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

Accepted Answer

Walter Roberson
Walter Roberson on 5 Dec 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 Comments
Roger Nadal
Roger Nadal on 11 Dec 2019
If I don’t want to generate random order for then should I remove randperm?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!