Expanding a matrix with for loop

1 Ansicht (letzte 30 Tage)
Mareeah L
Mareeah L am 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.

Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Produkte


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by