Replacing symbolic vector with changing values
Show older comments
I have a symbolic vector with repeating entries, similar to:
(cos(x), cos(x), cos(x), cos(x+5), cos(x+5)...)
and what i want to do is replace x with incrementing values so I can plot it. I have tried subs but it does not work properly. If my vector is the one i defined, i want my result to be
(cos(1), cos(2), cos(3), cos(4+5), cos(5+5)...)
but evaluated so that I may graph it. Is there a simple way to do this? I wrote an EXTREMELY inefficient loop that accomplished this by substituting the variable for the entire vector then storing only the necessary element into an output array, but it cannot handle the size i need.
Thanks
Accepted Answer
More Answers (0)
Categories
Find more on Labels and 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!