Expanding a matrix with for loop

1 view (last 30 days)
Mareeah L
Mareeah L on 9 Apr 2021
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.

Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Products


Release

R2017b

Community Treasure Hunt

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

Start Hunting!