Info
此问题已关闭。 请重新打开它进行编辑或回答。
Cases function: why do I get this message "array indices must be positive integers or logical values"
1 次查看(过去 30 天)
显示 更早的评论
Hey,
I want to wrtie the following function in matlab:
I get this message
"array indices must be positive integers or logical values"
It says there is a problem with the line:
else x1(t) = 0;
My code, if someone can help me to fix this :)
t = linspace (-5, 5, 1001);
if (abs(t) <= 1)
x1(t) = 1 - abs(t);
else x1(t) = 0;
end
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!