I would like to plot few values of a vector based on threshold setting from another vector.
Show older comments
clear all;
close all;
x=[1 2 3 4 5 6 7 8 9 10];
y=[1 2 3 4 5 6 7 8 9 10];
figure ()
plot(x(y>3 & y<5),y(y>3 & y<5))
if i will write plot(x(y>3 ),y(y>3)) it works, but I can not make it work for two different thresholds
Accepted Answer
More Answers (1)
x=[1 2 3 4 5 6 7 8 9 10];
y=[1 2 3 4 5 6 7 8 9 10];
x(y>3 & y<5)
y(y>3 & y<5)
figure
plot(x(y>3 & y<5),y(y>3 & y<5),'r')
figure
scatter(x(y>3 & y<5),y(y>3 & y<5),'r')
1 Comment
Panagiotis Bonas
on 3 Oct 2022
Categories
Find more on Profile and Improve Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

