Expanding a matrix with for loop
1 view (last 30 days)
Show older comments
A product from a for loop is a 1 x 20 matrix alfa and 1 x 20 matrix m.
I would like to expand the matrix alfa to 40 x 20 matrix by adding an equidistant increment with linspace to every value in the row.
I tried the following:
for j=1:numel(alfa)
b(j)= linspace(alfa(j),2*alfa(j),40)
r0(b)=m(b)./(cosd(alfa(b)/2));
end
but it's not working and I can't think of a solution.
Please let me know if you have a suggestion.
0 Comments
Answers (0)
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!