Plot functions in MATLAB

1 visualizzazione (ultimi 30 giorni)
hasan s
hasan s il 9 Ago 2021
Commentato: Les Beckham il 15 Ago 2021
Hello every one,
If possible..I need to draw these five functions (in the picture) at the same time so that the output is one drawing containing the drawing of all these five functions with one different color for each function..please, is this possible in MATLAB?
And put the square of the indicative color for each function on the output drawing.
This is my attempt, but I got an error while executing
If any Prof. can help me...thanks alots

Risposta accettata

Les Beckham
Les Beckham il 10 Ago 2021
Since I don't have the Statistics and Machine Learning Toolbox (for the unifrnd() function), I used the base Matlab function rand() instead.
% v1=unifrnd(0,1,1,m);
% l1=unifrnd(0,1,1,m);
% u1=unifrnd(1,2,1,m);
v1 = rand(1,m);
l1 = rand(1,m);
u1 = rand(1,m)*2;
That is the only change I made and the script generated a plot.
When you post a question to Matlab Answers, I would suggest showing the exact error message that you are seeing, or explaining how your result differs from what you expect. Please show your error message (all of the red text that comes up in the command window).
Your code is generating 100 different lines in the plot (since G is 100x101) rather than the 5 that you suggest that you expect.
  11 Commenti
hasan s
hasan s il 14 Ago 2021
This is exactly what I want, thank you very much prof. Les
Les Beckham
Les Beckham il 15 Ago 2021
Glad I could help.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Specifying Target for Graphics Output in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by