Effacer les filtres
Effacer les filtres

How to plot the variations of the maximum and minimum on 2 separate diagrams

5 vues (au cours des 30 derniers jours)
Francesco Muoio
Francesco Muoio le 9 Fév 2021
Commenté : Francesco Muoio le 10 Fév 2021
Hi everyone,
I obtained with the following code the plot for each image of the maximum and minimum distance (I have attached for example 3 plots but in reality there are more)
[max_value max_index]=max(mean(all_maxDist/distance_mm))
[min_value min_index]=min(mean(all_maxDist/distance_mm))
m= plot((max_index),max_value , 'ro', 'MarkerSize', 12, 'LineWidth', 2);
% Draw a line from the x-axis up to the max.
line([(max_index), (max_index)], [0,max_value ], 'Color', 'r', 'LineWidth', 2);
n=plot((min_index),min_value , 'ro', 'MarkerSize', 12, 'LineWidth', 2);
% Draw a line from the x-axis up to the min
line([(min_index), (min_index)], [0,min_value ], 'Color', 'r', 'LineWidth', 2);
Now ,I would like to get 2 graphs separately (one for the maximum and one for the minimum) that show me the variations that the maximum and the minimum undergo for each iteration (eventually finding a sort of square wave)
  8 commentaires
Rik
Rik le 10 Fév 2021
Do you only have the images, or do you have the data that was used to plot them? And from these 3*2 values, what output would you want?
Francesco Muoio
Francesco Muoio le 10 Fév 2021
I solved, thanks anyway!!!

Connectez-vous pour commenter.

Réponses (1)

KSSV
KSSV le 9 Fév 2021
Modifié(e) : KSSV le 9 Fév 2021
Read about the function stem
x = rand(1,10) ;
[val1,idx1] = min(x) ;
[val2,idx2] = max(x) ;
stem([idx1 idx2],[val1 val2])
xlim([0 10])
  1 commentaire
Francesco Muoio
Francesco Muoio le 9 Fév 2021
Modifié(e) : Rik le 10 Fév 2021
KSSV for each iteration I want you to describe me a real trend of the variations and not a stem.
In the end I want to get only one final graph for maximum variations and only one graph for minimum variations.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by