Creating a two dimensional array using a for loop with two variables as a parameter
1 次查看(过去 30 天)
显示 更早的评论
Hello
I'm still working on my car model. I want to run my model in a for loop so I don't need to insert the parameters again after each run. The input variables of my model are steering angle (d) and velocity (v). I need to do runs with 3 different d's and 3 different v's. The result should look like this
Result(d1, d2, d3; v1, R1, R2, R3; v2, R4, R5, R6; v3, R7, R8, R9)
I already have: v = [10,15,20]; d = [8,10,12];
for x=v, y=d
h.assignin('v',x);
h.assignin('d',y);
but does Matlab give the output I want when I do this?
Thanks
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!