-1 and 1 matrix
显示 更早的评论
Hello All,
I want to create a n X n matrix with 1row 1, 2nd row -1, 3rd row 1 , 4th row -1 and so on..... can anyone please guide me .......... thanks.........
采纳的回答
更多回答(2 个)
Andrei Bobrov
2015-5-5
-(-1).^(1:5)'*ones(1,5);
3 个评论
Stephen23
2015-5-5
Very nice!
Offroad Jeep
2015-5-5
Andrei Bobrov
2015-5-5
please accept my answer too! :)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!