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개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by