Please suggest a method using Vectorization.
1 回表示 (過去 30 日間)
古いコメントを表示
I want to do the following operation using vectorization technique of Matlab. I am a novice user of matlab. So please tell me how i can get the following operation done without using the FOR Loop.
x=[1 2 3 4 5 6 7 8 9 10 11 1 2];
for i=1:length(x)
x(i)=((-1)^i)*x(i);
end
0 件のコメント
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!