function results into a vector
조회 수: 4 (최근 30일)
이전 댓글 표시
I have this code which I want to have output a vector which I can then plot versus the input but the answer Vreg comes out as a single number. How can I get the function to output a vector evaluated at each value of the input vector?
VL = 0:.1:500;
Vreg = [(230-(VL))/(VL)];
plot(VL,Vreg)
댓글 수: 0
답변 (2개)
the cyclist
2019년 9월 21일
편집: the cyclist
2019년 9월 21일
You need element-wise division. Try
Vreg = [(230-(VL))./(VL)];
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!