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!