![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/282679/image.png)
How I can print out only the numbers over the threshold and keep each number in the same place ?
2 次查看(过去 30 天)
显示 更早的评论
How I can print out only the numbers over 30 and keep each number in the same place ? to able to plot and shows which sample is over 30 !
I want show the real value 30-50 = 20 not 1 and zero !
x= randi([20 50],163,50)
1 个评论
darova
2020-4-7
plot( randi([3 5],10,10) )
ylim([ 2 6 ])
Everything is between 3 .. 5. What is the problem?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/282679/image.png)
采纳的回答
Sindar
2020-4-8
Plots will exclude NaN values, but keep the rest of the data in place. So, here's a trick:
data ./ (condition)
Where condition is true, this will return the data (data/1)
Where condition is false, this will return NaN (data/0)
So:
y = randi([20 50],163,50);
miny = 30;
plot(y./(y>=miny))
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Two y-axis 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!