How to repeat the value of y to have the same length as x?
1 view (last 30 days)
Show older comments
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 Comments
Answers (1)
See Also
Categories
Find more on Annotations 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!