How to repeat the value of y to have the same length as x?
1 次查看(过去 30 天)
显示 更早的评论
I need to add a text to a plot.
text(x,max(E),'it is inf')
and the length of x can be more than one. so I will get the error because the length of x and y (max(E)) are not matching. I want to form y by repeating max(E) with the size of x. For example if the size of x is 4, then I wan to have y=[max(E),max(E),max(E),max(E)]. What is the shortest way to do it?
I want to avoid for loop as much as possible.
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!