how can i add more than two elements to an array ?
Show older comments
if i have
x=[1,2,3,4]
syms t
i=1 ;
for i=1:3
switch x(i)
case 1
x1=cos(t)
case 2
x2=sin(t)
case 3
x3=sin(2t)
end
i=i+1
end
i want to have array x that contains y=[x1,x2,x3]
so x=[cos(t),sin(t),sin(2t),cos(7t)]
i want a method to this operation because i want to use it in a loop or switch ?
how can i do this in MATLAB ?
Accepted Answer
More Answers (0)
Categories
Find more on Operations on Strings in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!