Not sure how to fix my matrix dimension problem
1 view (last 30 days)
zeta=[0, 0.1, 0.25, 0.5, 0.75, 0.9, 1];
Adam Danz on 29 Mar 2020
Edited: Adam Danz on 29 Mar 2020
t is a 1x41 vector; wd and zeta are both 1x7 vectors. You can't do pairwise multiplication with two arrays of different size.
Base on the line plot(t,x) I assume you are expecting t to have the same number of elements as x in which case t will also need to be a 1x7 vector.
Perhaps you're looking for
t = linspace(0,4,numel(zeta));
t = cumsum([0, 0.1 * ones(1,numel(zeta)-1)]);
But there's another problem/mystery: you're not using the i variable within your loop and the values for x will never change within the loop so you'll end up plotting the same line over and over again.
MaryD on 29 Mar 2020
You are using for loop with variable i but you are not using i inside the loop. I'm not sure what you want to achive but maybe this will work