Effacer les filtres
Effacer les filtres

how do I make script that plots values from workspace dividing into the case

3 vues (au cours des 30 derniers jours)
i have workspace where it has two valuables 'X'&'Y' .Each valuable has 10001 dates(this date is randam numbers from -3.14 to 3.14 and they are vector X is10001x1,Y is 10001x1)
Using this,I want to make a script that make a line graph.i want to use numbers from valuable X on x axis and from valuable Y on y axis from top to bottom, but when the sign of numbers of X and Y is same,don't plot and skip to next number.
I know how to plot dates from workspace on graph,but i don't know how to write underlined part.please help!

Réponse acceptée

Chunru
Chunru le 1 Déc 2021
x = randn(101, 1);
y = randn(101, 1);
idx = x.*y > 0; % same signs
plot(x(~idx), y(~idx), 'ro'); grid on
  1 commentaire
拓郎 岡畑
拓郎 岡畑 le 2 Déc 2021
thank you for your question!i can make a suitable script by your support

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Simulink dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by