Column vector with interval
이전 댓글 표시
Hi all, I'm looking for a way to create a column vector using something similar to "linspace". I saw that this is used to create ROW vectors with a starting point, an ending point and an interval (2,10,0.1). I should do a column vector for 2 to 0 with an interval of -0.1. Every time I try to do that I receive the "error (?)" Empty matrix: 1-by-0. How can I solve the problem? Is there a command as linspace for column row?
채택된 답변
추가 답변 (2개)
Azzi Abdelmalek
2015년 2월 25일
v=2:-0.1:0
v=v'
लिनस्पेस और : ऑपरेटर दोनों ही पंक्ति सदिश बनाते हैं। लेकिन क्या होगा यदि आपको रैखिक रूप से स्थानित स्तंभ सदिश की आवश्यकता है? ट्रांसपोज़ ऑपरेटर (') पंक्ति सदिश को स्तंभ सदिश में परिवर्तित करता है। x = 1:3 x = 1 2 3 x = x' x = 1 2 3 कार्य ट्रांसपोज़ ऑपरेटर का उपयोग करके पंक्ति सदिश से स्तंभ सदिश में b को ट्रांसपोज़ करें।
The linspace and : operators both create row vectors. But what if you need a linearly spaced column vector? The transpose operator (') converts a row vector to a column vector. x = 1:3 x = 1 2 3 x = x' x = 1 2 3 Function Transpose b from a row vector to a column vector using the transpose operator.
카테고리
도움말 센터 및 File Exchange에서 Debugging and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!